This file contains 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
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 |
This file contains 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 '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" |
This file contains 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
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' |
This file contains 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
>>>>> 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+^ |
This file contains 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
compact_app = <<COMPACT | |
require 'foundations/compact' | |
module #{app_name} | |
include Waves::Foundations::Compact | |
module Resources | |
class Map | |
end |
This file contains 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
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' |
This file contains 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/orm/sequel' | |
require 'layers/renderers/markaby' | |
require 'syntaxi' | |
module Spit | |
include Waves::Foundations::Compact | |
include Waves::Layers::ORM::Sequel | |
include Waves::Layers::Renderers::Markaby |
This file contains 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 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
rules for the library: | |
1) never disrespect the silence (being loud in a library == embarrassing yourself). |
This file contains 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
i=1 | |
colors.each do |color| | |
td.color#{i}! :background => color | |
i++ | |
end |