Skip to content

Instantly share code, notes, and snippets.

View jrgifford's full-sized avatar
:shipit:
This is like AIM all over again, isn't it?

James Gifford jrgifford

:shipit:
This is like AIM all over again, isn't it?
View GitHub Profile
@defunkt
defunkt / resque.py
Created November 3, 2009 19:49
Resque client in Python
from redis import Redis
import simplejson
class Resque(object):
"""Dirt simple Resque client in Python. Can be used to create jobs."""
redis_server = 'localhost:6379'
def __init__(self):
host, port = self.redis_server.split(':')
self.redis = Redis(host=host, port=int(port))
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@jc00ke
jc00ke / test_rack_config.rb
Created January 17, 2011 04:27
Use Rack::Builder.parse_file to test your config.ru
We couldn’t find that file to show.
@Benjol
Benjol / autoreviewcomments.user.js
Last active February 4, 2022 18:34
Add pro-forma comments dialog for reviewing (pre-flag)
// ==UserScript==
// @name AutoReviewComments
// @namespace benjol
// @version 1.3.1
// @description Add pro-forma comments dialog for reviewing (pre-flag)
// @grant none
// @include http*://*stackoverflow.com/questions*
// @include http*://*stackoverflow.com/review*
// @include http*://*stackoverflow.com/admin/dashboard*
// @include http*://*stackoverflow.com/tools*
anonymous
anonymous / gist:847653
Created February 28, 2011 17:19
a.button {
background: -webkit-gradient(linear, left top, left bottom, from(#50A7E7), to(#3679CF));
background: -moz-linear-gradient(top, #50A7E7, #3679CF);
border: 1px solid #4081AF;
color: #fff;
cursor: pointer;
font: 12px/100% 'Lucida Grande';
padding: 4px 15px;
text-decoration: none;
text-shadow: 0 1px 0 rgba(0,0,0,.5);
@ericsaboia
ericsaboia / gist:994614
Created May 27, 2011 03:58
Changelog ActiveRecord:Base Rails 3.1
# ActiveRecord::Base#dup and ActiveRecord::Base#clone semantics have changed to closer match normal Ruby dup and clone semantics.
# Calling ActiveRecord::Base#clone will result in a shallow copy of the record, including copying the frozen state. No callbacks will be called.
# Calling ActiveRecord::Base#dup will duplicate the record, including calling after initialize hooks. Frozen state will not be copied, and all associations will be cleared. A duped record will return true for new_record?, have a nil id field, and is saveable.
@czottmann
czottmann / Procfile
Created June 15, 2011 13:43
Example of a Foreman/Capistrano/upstart setup
worker: QUEUE=* bundle exec rake environment resque:work
scheduler: bundle exec rake environment resque:scheduler
@msimpson
msimpson / cfire
Created July 21, 2011 10:51
Curses based ASCII art fire animation.
#!/usr/bin/python
import curses, random
screen = curses.initscr()
width = screen.getmaxyx()[1]
height = screen.getmaxyx()[0]
size = width*height
char = [" ", ".", ":", "^", "*", "x", "s", "S", "#", "$"]
b = []
@senko
senko / onchange.sh
Last active July 14, 2023 07:54
OnChange - Watch current directory and execute a command if anything in it changes
#!/bin/bash
#
# Watch current directory (recursively) for file changes, and execute
# a command when a file or directory is created, modified or deleted.
#
# Written by: Senko Rasic <senko.rasic@dobarkod.hr>
#
# Requires Linux, bash and inotifywait (from inotify-tools package).
#
# To avoid executing the command multiple times when a sequence of
@paultag
paultag / huzzah!
Created August 22, 2011 15:29
tarball generator
#!/bin/bash
BUILD_DIR=/var/builds
GNUPG_KEY=DBC1F58D
MIRRORDIR=/git/
WORKDIR=/tmp/$$.d/
echo "Creating workdir: $WORKDIR"
mkdir $WORKDIR