Skip to content

Instantly share code, notes, and snippets.

View ab5tract's full-sized avatar

ab5tract ab5tract

  • Amsterdam, Netherlands
View GitHub Profile
#!/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 );
}
require 'foundations/simple'
module Blog
include Waves::Foundations::Simple
end
def self.dependencies( *args )
self['dependencies'] ||= Set.new
args.length == 0 ? self['dependencies'] :
self['dependencies'] += ( args - gems.dependencies )
end
def self.dependencies( *args )
self['dependencies'] ||= Set.new
args.length == 0 ? self['dependencies'] + gems.dependencies :
( self['dependencies'] += ( args - gems.dependencies ) )
end
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)
@ab5tract
ab5tract / spit.rb
Created October 23, 2008 04:19 — forked from ab5tract/spit.rb
require 'foundations/compact'
require 'layers/renderers/markaby'
require 'syntaxi'
require 'sequel'
module Spit
include Waves::Foundations::Compact
include Waves::Renderers::Markaby
# Framework
require 'foundations/compact'
# Gems
require 'palettes'
require 'cassandra'
# App
require 'views'
@ab5tract
ab5tract / README
Created February 5, 2009 03:43 — forked from automatthew/README
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.
@ab5tract
ab5tract / sha1.p6
Last active December 11, 2015 19:30 — forked from cognominal/sha1.p6
sha1 hash
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 {