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
body | |
background-image linear-gradient(top, sky, 80% sky, sky*0.7) | |
background-attachment fixed | |
/////////////////////////////////////////////////////////////// | |
// from https://github.com/visionmedia/nib/blob/master/lib/nib/gradients.styl | |
linear-gradient(start, stops...) | |
error('color stops required') unless length(stops) | |
prop = current-property[0] |
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 coffee = require('coffee-script'), | |
cs = require('fs').readFileSync('./app.coffee', 'ascii'); | |
eval(coffee.compile(cs)); |
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
importScripts 'jsonp-worker.coffee' | |
jsonp 'http://api.twitter.com/1/followers/ids.json?cursor=-1&screen_name=ev&callback=?', (response) -> | |
# process response |
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
# adapted from http://dekstop.de/weblog/2006/02/recursive_ruby_opml_parser/ | |
# Returns a map from URL => text-field | |
require 'rexml/Document' | |
def parse_opml(opml) | |
if opml.is_a? String | |
doc = REXML::Document.new(opml) | |
opml = doc.elements['opml/body'] | |
end | |
feeds = {} |
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
# example (untested) | |
class Post | |
include Slugged | |
end | |
post.create :title=>'Great Gist' | |
post.slug == 'great-gist' # true |
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
# extends http://snippets.dzone.com/posts/show/2348 | |
# to include an option for escaping control | |
# flash[:success] = 'it worked!' will escape (safe) as per Rails 3 security measure, which | |
# defaults content_tag escaping to true | |
# flash[:explicit_success] = 'it <b>worked</b>!' will | |
module ApplicationHelper | |
FLASH_TYPES = [:error, :warning, :success, :notice] |
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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Sebastien P. https://twitter.com/#!/_sebastienp | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
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 re = /http:\/\/\S+/g; | |
var s = document.body.innerHTML; | |
var m; | |
do { | |
m = re.exec(s); | |
if (m) { | |
console.log(m[0]); | |
document.body.innerHTML += '<li> <a href="'+m[0]+'">'+m[0]+'</a>'; | |
} |
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
isLocal = (url) -> ! /^[a-zA-Z0-9+-\.]+:/.test(url) |
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
/default is "true". this will also work with default "false"(by changing "true" below to "false"). | |
- if ( local_assigns.has_key?(:show_message) ? show_message : true ) |