I hereby claim:
- I am liquid on github.
- I am attilagyorffy (https://keybase.io/attilagyorffy) on keybase.
- I have a public key whose fingerprint is 4B63 1024 9312 B168 1147 63E3 4C63 6AA2 A514 B1FB
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
# Free RESTful interface for your Ruby objects with Rackable | |
# http://github.com/madx/rackable/tree/master | |
# | |
# + Free HTTP caching with rack-cache | |
# http://github.com/rtomayko/rack-cache/tree/master | |
require 'rackable' | |
require 'rack/cache' | |
APP_ROOT = File.dirname(__FILE__) |
#!/usr/bin/env ruby | |
def usage | |
puts "./pair [name] [name]: pair two people (set the user in git)" | |
puts "./pair reset: revert to default settings" | |
exit | |
end | |
if ARGV.size == 2 | |
pair = [ARGV[0], ARGV[1]] |
/* Ismael Celis 2010 | |
Simplified WebSocket events dispatcher (no channels, no users) | |
var socket = new ServerEventsDispatcher(); | |
// bind to server events | |
socket.bind('some_event', function(data){ | |
alert(data.name + ' says: ' + data.message) | |
}); |
module SectionHelpers | |
def selector_of_section(section_name) | |
case section_name | |
when 'recent podcasts' | |
[:css, 'ul.podcasts'] | |
when /^the row containing "[\"+]"$/ | |
[:xpath, "//*[.='#{$1}']/ancestor::tr"] | |
else | |
raise "Can't find mapping from \"#{section_name}\" to a section." | |
end |
// Ghetto fabulous template system for replacing values in strings. If {{.foo}} | |
// or {{.bar[0].baz}} is encountered (leading . or ( or [ char), attempt to | |
// access properties of data object like `data.foo` or `data.bar[0].baz`. | |
// Alternately, if {{foo}} or {{bar("baz")}} is encountered (no leading dot), | |
// simply evaluate `foo` or `bar("baz")`. If an error occurs, return empty | |
// string. Oh yeah, you have to pass the result of ghettoTmpl to eval. :) | |
function ghettoTmpl(data, str) { | |
ghettoTmpl._data = data; | |
ghettoTmpl._str = str; |
find . -exec iconv -t UTF-8 {} \; |
/** | |
* jQuery.support.cssProperty | |
* To verify that a CSS property is supported (or any of its browser-specific implementations) | |
* | |
* @param string p - css property name | |
* [@param] bool rp - optional, if set to true, the css property name will be returned, instead of a boolean support indicator | |
* | |
* @Author: Axel Jack Fuchs (Cologne, Germany) | |
* @Date: 08-29-2010 18:43 | |
* |
# Put this file under Rails.root /lib | |
class CssColourValidator < ActiveModel::EachValidator | |
def validate_each(record, attribute, value) | |
return false unless value | |
record.errors[attribute] << (options[:message] || 'is not a valid CSS colour') unless ::HexadecimalColourValidator.matches?(value) or ::WebSafeColourValidator.matches?(value) | |
end | |
end |
// Destroys the localStorage copy of CSS that less.js creates | |
function destroyLessCache(pathToCss) { // e.g. '/css/' or '/stylesheets/' | |
if (!window.localStorage || !less || less.env !== 'development') { | |
return; | |
} | |
var host = window.location.host; | |
var protocol = window.location.protocol; | |
var keyPrefix = protocol + '//' + host + pathToCss; |