Skip to content

Instantly share code, notes, and snippets.

@seaofclouds
seaofclouds / staticizer.rb
Created March 14, 2009 02:49 — forked from rtomayko/staticizer.rb
add static file export to sinatra apps!
# http://groups.google.com/group/sinatrarb/browse_thread/thread/84d525759af8615a
require 'fileutils'
class Staticizer
def initialize(app, cache_path)
@app = app
@cache_path = cache_path
end
def call(env)
@seaofclouds
seaofclouds / happy birthday, chris
Created March 13, 2009 16:34
wish defunkt a happy birthday and fork this gist!
.__ ___. .__ __ .__ .___
| |__ _____ ______ ______ ___.__. \_ |__ |__|_______ _/ |_ | |__ __| _/_____ ___.__.
| | \ \__ \ \____ \ \____ \< | | | __ \ | |\_ __ \\ __\| | \ / __ | \__ \ < | |
| Y \ / __ \_| |_> >| |_> >\___ | | \_\ \| | | | \/ | | | Y \/ /_/ | / __ \_\___ |
|___| /(____ /| __/ | __/ / ____| |___ /|__| |__| |__| |___| /\____ | (____ // ____|
\/ \/ |__| |__| \/ \/ \/ \/ \/ \/
_____ ___ ___ ___ ___ ___
/ /::\ / /\ / /\ /__/\ /__/\ /__/| ___
/ /:/\:\ / /:/_ / /:/_ \ \:\ \ \:\ | |:| / /\
/ /:/ \:\ / /:/ /\ / /:/ /\ \ \:\ \ \:\ | |:| / /:/
punctuation woes:
This is my fancy address-like note
Harrison’s Office
8 Fancy Bldg. / 27 Fancy Drive
Fancyville, Fl 12345
$(".tweet").tweet({
username: ["robbmajor","MattFid","chadengle","seaofclouds"]
count: 9,
loading_text: "loading tweets..."
});
# BAD:
foo.bar = 25
foo.biz = 'Hello World'
foo.bazzle = 42
# GOOD:
foo.bar = 25
foo.biz = 'Hello World'
foo.bazzle = 42
# get git branch name
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
# set prompt
PS1="\[\e[37;45;1m\][\u@\h]\[\e[0m\[\e[35m\] \w\$(parse_git_branch) #\[\e[0m\] "
@seaofclouds
seaofclouds / README
Created November 3, 2008 19:40
feeling meh? you're not the only one: http://meh.seaofclouds.com
feeling meh? you're not the only one: http://meh.seaofclouds.com
itz beganz az ze rainy dayz experiment in parzings ze informationz on ze twitterz
-- Skwisgaar Skwigelf
bundled with sinatra in two versions:
1) atom/nethttp/uri
2) httparty/json
haven ze fun
require 'rubygems'
require 'atom' # sudo gem install atom
require 'net/http'
require 'uri'
feed_url = 'http://search.twitter.com/search.atom?q=meh'
begin
feed = Atom::Feed.new(Net::HTTP::get(URI::parse(feed_url)))
feed.entries.each do |entry|
@seaofclouds
seaofclouds / translations.yml
Created October 4, 2008 08:02
help localize http://browserchallenge.com and translate this english yaml file to your language!
en:
good: good
good_intro: you're using
good_outro: ", a good web browser."
good_browser: good browser
good_badge_intro: show the world you care about web standards and put the browser challenge badge on your site.
bad: bad
bad_intro: treat yourself to something good.
bad_outro: upgrade to <a href='http://www.apple.com/safari/download/'>safari</a> or <a href='http://firefox.com/'>firefox</a> today!
bad_browser: bad browser
%form#form_name.form_type
%fieldset
%label label
%input.text{:type=>"text"}
%p.help
%small this is a help for the preceding field
%button.submit