Skip to content

Instantly share code, notes, and snippets.

flash.keys.each do |f|
content_tag(:p, flash[f], :class => "flash #{f}")
end
>> flash[:notice] = 'A notice'
=> <p class="flash notice">A notice</p>
@ahoward
ahoward / application.js
Created January 11, 2011 00:28
flash partial
// add a flash message
//
App.flash = function(msg, options){
options = options || {};
var flash = jQuery('.flash');
var template = App.templates['flash-list-item'];
var data = {'message' : msg};
var message = jQuery.tmpl(template, data);
@kvangork
kvangork / jaconda.user.js
Created January 28, 2011 05:23
Userscript for Growl notifications - Jaconda Fluid app - modify myRegexpNotify and windowTitle vars
var mostRecentMessageID = 0;
var myRegexpNotify;
function onAppInFG(){
window.fluid.dockBadge = "";
}
function callbackNewMessage(m){
if( !m.sender_name.match( myRegexpNotify ) ){
@ches
ches / pow
Created April 14, 2011 07:43
A quick script to switch between running Pow and Apache on OS X
#!/bin/sh -e
#/ Usage: pow [on|off]
#/ Toggle between running Pow (http://pow.cx) and Apache on Mac OS X.
# Show Usage
function usage {
grep '^#/' "$0" | cut -c4-
exit 2
}
[ -z "$1" -o "$1" = "--help" ] && usage
@joakimk
joakimk / HipChatOptimized.user.css
Created April 21, 2011 22:19
Quick userscript to make HipChat more like irssi
div.input {
background-color: #555 !important;
border-top: 1px solid #aaa !important;
}
.topic_container {
background-color: #222 !important;
color: #aaa !important;
}
@bentruyman
bentruyman / Custom.css
Created August 17, 2011 00:30
IR_Black Theme for Chrome Developer Tools
/**********************************************/
/*
/* IR_Black Skin by Ben Truyman - 2011
/*
/* Based on Todd Werth's IR_Black:
/* http://blog.toddwerth.com/entries/2
/*
/* Inspired by Darcy Clarke's blog post:
/* http://darcyclarke.me/design/skin-your-chrome-inspector/
/*
@davist11
davist11 / gist:1204569
Last active July 1, 2024 02:51
Campfire sounds
56k: "https://123.campfirenow.com/images/56k.gif"
bell: ":bell:"
bezos: ":laughing::thought_balloon:"
bueller: "anyone?"
butts: ":open_hands: :smoking:"
clowntown: "https://123.campfirenow.com/images/clowntown.gif"
cottoneyejoe: ":notes::hear_no_evil::notes:"
crickets: "hears crickets chirping"
dadgummit: "dad gummit!! :fishing_pole_and_fish:"
dangerzone: "https://123.campfirenow.com/images/dangerzone.png"
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@leshill
leshill / Procfile
Created November 28, 2011 20:01
Unicorn config for cedar stack on Heroku.
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
@nono
nono / redis2txt.rb
Created November 28, 2011 23:29
Export data from redis to a plain text files
#!/usr/bin/env ruby
require "redis"
redis = Redis.new
redis.keys("*").each do |key|
val = case redis.type(key)
when "string"
redis.get key
when "list"