This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
subset Sha1 of Str where *.chars == 40 and m:i/<[A..Z 0..9]>/; | |
class Sha1H does Associative { | |
has $!sha1; | |
has %!h{Sha1(Str)}; | |
method AT-KEY($_) { %!h{ .lc } }; | |
method ASSIGN-KEY($_, $v) { %!h{ .lc } = $v } | |
} | |
class Sha1Str is Str { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl6 | |
use Test; | |
sub overlaps-with( $r1, $r2 ) { | |
$r1.min ~~ $r2 and $r1.max ~~ $r2 or $r2.min ~~ $r1 and $r2.max ~~ $r1 | |
or ( $r1.min == $r2.min and ($r1.max <= $r2.max or $r2.max <= $r1.max) ) | |
or ( $r2.min < $r1.min < $r2.max <= $r1.max ) | |
or ( $r1.min < $r2.min < $r1.max <= $r2.max ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Stop putting "require 'rubygems'" in your project files. Just madly require | |
away, assuming that whatever you need will be found in the load path. | |
Install dollarspots.rb early in your loadpath. It checks the pwd for a file | |
named .dollarspots.rb and loads it if found. Use .dollarspots.rb files locally | |
in projects to jigger with your loadpath such that your reckless requires | |
actually work. Note that this may involve saying "require 'rubygems'". | |
Call ruby with -rdollarspots, or set "rdollarspots" as your RUBYOPT. To get TextMate's RubyMate facilities to work you'll need to edit the RUBYOPT shell variable in the Prefs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Framework | |
require 'foundations/compact' | |
# Gems | |
require 'palettes' | |
require 'cassandra' | |
# App | |
require 'views' | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'foundations/compact' | |
require 'layers/renderers/markaby' | |
require 'syntaxi' | |
require 'sequel' | |
module Spit | |
include Waves::Foundations::Compact | |
include Waves::Renderers::Markaby | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Runtime config attributes | |
host | |
port (will it be possible for an app to have a separate port?) | |
log (i'm beginning to see that runtime level logs may be best. perhaps the runtime could have an optional "log viewer" waves app built in that could sort out stuff 'per app') | |
debug | |
synchronize? | |
application (rack builder block) | |
mime_types | |
resources (routing) | |
handler (rack handler) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def self.dependencies( *args ) | |
self['dependencies'] ||= Set.new | |
args.length == 0 ? self['dependencies'] : | |
self['dependencies'] += ( args - gems.dependencies ) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def self.dependencies( *args ) | |
self['dependencies'] ||= Set.new | |
args.length == 0 ? self['dependencies'] + gems.dependencies : | |
( self['dependencies'] += ( args - gems.dependencies ) ) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'foundations/simple' | |
module Blog | |
include Waves::Foundations::Simple | |
end | |