Skip to content

Instantly share code, notes, and snippets.

View ab5tract's full-sized avatar

ab5tract ab5tract

  • Amsterdam, Netherlands
View GitHub Profile
module Experimental
class Palette
def initialize(colors)
@colors = []; @names = {}
if colors.first.length == 2 # This is how we prefer our input, but you can make a palette without it.
colors.each {|n, c| @names[n] = c; @colors << c }
else
colors.each {|c| @colors << c }
end
end
require 'test'
plan 2
a = {"b" => "c", "d" => "e"}
a.clear
is a["b"], nil, "hash can clear"
is a.key? "d", false, "hash can clear"
module Palettes
module ColourLovers
class Palette
include Palettes::Mixin
# It's a Party!
require 'httparty'
include HTTParty
base_uri 'colourlovers.com'
default_params :format => 'json'
@ab5tract
ab5tract / README
Created October 8, 2008 23:44
esoteric boobies
>>>>> This Gist exists self-conscious of its relative childishness. <<<<<<
It is in the spirit of unabashed love that we write this code, in languages beyond count and, often,
comprehension.
.oO( <3 <3 <3 )
v >+"="v v,,\<
>"ctra"v \ >-"tab"> :#^_@
>:4:*1+^
compact_app = <<COMPACT
require 'foundations/compact'
module #{app_name}
include Waves::Foundations::Compact
module Resources
class Map
end
option :generate do
option :orm do
short '-o'
long '--orm=ORM'
desc "Select an ORM (e.g. active_record, sequel, none)"
default "sequel"
end
option :template do
short '-t'
require 'foundations/compact'
require 'layers/orm/sequel'
require 'layers/renderers/markaby'
require 'syntaxi'
module Spit
include Waves::Foundations::Compact
include Waves::Layers::ORM::Sequel
include Waves::Layers::Renderers::Markaby
@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
rules for the library:
1) never disrespect the silence (being loud in a library == embarrassing yourself).
i=1
colors.each do |color|
td.color#{i}! :background => color
i++
end