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
Shoes.app :title => 'Shoes Colors', :width => 600, :height => 600 do | |
colors = Shoes::COLORS.to_a.sort_by { |k, v| v.to_s } | |
colors.each do |name, color| | |
flow :width => 0.33 do | |
background color | |
para strong(name), "\n", color, :stroke => (color.dark? ? white : black), | |
:margin => 4, :align => 'center' | |
end | |
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
#!/usr/local/bin/ruby | |
# -*- encoding:utf-8 -*- | |
require 'readline' | |
require "/Users/keyes/Dropbox/lib/ruby_class_list/rbutils" | |
class String | |
def to_score(abbrev) | |
return 0.9 if abbrev.empty? | |
return 0.0 if length < abbrev.length |
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
#!/opt/local/bin/ruby1.9 | |
#-*-encoding: utf-8-*- | |
class Env < Hash | |
def initialize(parms=[], args=[], outer=nil) | |
h = Hash[parms.zip(args)] | |
self.merge!(h) | |
@outer = outer | |
end | |
def find(key) |
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
ArrayList letters; | |
PFont font; | |
int numLetters; | |
void setup(){ | |
size(320, 460); | |
letters = new ArrayList(); | |
numLetters = 100; | |
font = createFont("Helvetica", 18, true); | |
smooth(); |
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
#!/usr/bin/env ruby | |
#-*-encoding: utf-8-*- | |
# | |
require "pathname" | |
class EaseSinatra | |
module Builder | |
MAIN_DIR = Pathname.pwd | |
BASE_NAME = "app" # MAIN_DIR.split[1] | |
MAIN_NAME = "#{BASE_NAME}.rb" |
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
var canvas = {}; | |
$(document).ready(function(){ | |
canvas.self = $("canvas#clock"); | |
canvas.ctx = canvas.self[0].getContext('2d'); | |
canvas.width = canvas.self.width(); | |
canvas.height = canvas.self.height(); | |
canvas.ctx.translate(canvas.width/2, canvas.height/2); | |
clock(70); |
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
<?xml version="1.0"?> | |
<root> | |
<list> | |
<item> | |
<name>My Custom Keys</name> | |
<list> | |
<item> | |
<name>Remap Ctrl+Semicolon to Equal</name> | |
<identifier>remap.ctrlsemicolon2equal</identifier> | |
<autogen>--KeyToKey-- KeyCode::SEMICOLON, VK_CONTROL, KeyCode::EQUAL</autogen> |
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 './chinatra' | |
require 'haml' | |
require 'myroute' |
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
# encoding: UTF-8 | |
class Array | |
alias __eq__ === | |
def ===(other) | |
if self.size == other.size and any? { |item| item.instance_of? Class } | |
other = other.to_enum | |
return all? { |item| item === other.next } | |
end | |
__eq__(other) | |
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
source :rubygems | |
gem 'sinatra' | |
gem 'haml' | |
gem 'sass' | |
gem 'dalli' | |
gem 'nokogiri' |