Skip to content

Instantly share code, notes, and snippets.

@schacon
schacon / 0_reuse_code.js
Created December 3, 2013 16:57
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@schacon
schacon / showme
Created February 17, 2011 18:26 — forked from maddox/showme
#!/usr/bin/env ruby
#
# SHOW ME
# Takes X pictures of you via your iSight, animates them, uploads them to CloudApp, and puts
# the url in your clipboard
#
# This uses a bunch of projects to make the magic happen, mostly thanks
# to Zach Holman: http://github.com/holman
#
#
/* Facebook-style buttons by @DHS */
.inputbutton {
background: #3b5998;
color: white;
padding: 2px 18px 3px 18px;
border-top: 1px white solid;
border-left: 1px white solid;
border-right: 1px #000033 solid;
border-bottom: 1px #000033 solid;
require "rubygems"
require "activerecord"
require '../../munger/lib/munger'
ActiveRecord::Base.establish_connection(
:adapter => "postgresql",
:host => "localhost",
:database => "testing",
:username => "postgres",
:password => "postgres"
@schacon
schacon / gist:40382
Created December 28, 2008 05:29 — forked from foca/gist:40376
$ git clone git://github.com/foca/webrat.git
Initialized empty Git repository in /private/tmp/webrat/.git/
remote: Counting objects: 4258, done.
remote: Compressing objects: 100% (1432/1432), done.
remote: Total 4258 (delta 2873), reused 4115 (delta 2770)
Receiving objects: 100% (4258/4258), 11.44 MiB | 620 KiB/s, done.
Resolving deltas: 100% (2873/2873), done.
@schacon
schacon / gist:29880
Created November 28, 2008 02:03 — forked from pjhyett/dedup.rb
#! /usr/bin/ruby
##
# Remove any duplicate tracks in iTunes
# PJ Hyett was here 11/2008
framework "Cocoa"
framework "ScriptingBridge"
itunes = SBApplication.applicationWithBundleIdentifier("com.apple.iTunes")
;; Issac Trotts' demonstration of pattern matching in Nu
(function people-to-string (people)
(match people
(() "no people")
((p1) "one person: #{p1}")
((p1 p2) "two people: #{p1} and #{p2}")
(else "too many people: #{(people length)}")))
(assert_equal "no people"
@schacon
schacon / gistie.rb
Created July 22, 2008 14:17 — forked from anonymous/gistie
create a gist on the command line
#!/usr/bin/env ruby
require "tempfile"
GIST_URL = 'http://gist.github.com/gists'
if ARGV.include? "-p"
text = `pbpaste`
elsif !ARGV.empty?
@filename = ARGV.shift
text = File.read(File.expand_path(@filename))
@schacon
schacon / GitUseCases.txt
Created July 21, 2008 23:30 — forked from sr/GitUseCases.txt
formatted nicer
01:21 <schacon> well like, lets say you use Emacs, and someone
posts an extension on gists, like this: http://gist.github.com/290
01:22 <schacon> you use it and think it's cool, but add some
features, so you can fork it, make your change and even email
the original author, who can add you as a remote and merge your
change in, or several peoples changes and push back
01:23 <schacon> you have a list of all the gists you've ever made,
and can always go back and edit or update them: http://gist.github.com/mine
01:24 <schacon> if you have a multi-file project, like a little
sinatra app that maybe doesn't warrant it's own github project,
@schacon
schacon / gist:20
Created July 20, 2008 19:17 — forked from mojombo/wtf.rb
.,mlkmlkml