Public Gists by ssoper

gist: 227168 Useful bash commands
Gravatar
Thu Nov 05 08:20:47 -0800 2009
1
2
# output from clipboard directly to file
sudo sh -c "pbpaste > file"
gist: 226540 random numbers
Gravatar
Wed Nov 04 16:16:39 -0800 2009
1
2
3
d = []
while 1 == 1
d << rand(1000)
gist: 222067 Throw this in your config/i...
Gravatar
Thu Oct 29 19:50:21 -0700 2009
1
2
3
# Throw this in your config/initializers dir for some hot tag cloud action using the is_taggable gem
 
module TaggableExtensions
Gravatar
Tue Oct 27 17:34:09 -0700 2009
1
2
3
# Using ruby to cleanup any pesky X instances
 
require 'fileutils'
gist: 188799 Tail-Call Optimized odds ca...
Gravatar
Thu Sep 17 17:09:44 -0700 2009
1
2
3
#import <Cocoa/Cocoa.h>
 
// Based on Paul Barry's Tail-Call Optimized odds calculator
Gravatar
Tue Aug 25 10:15:14 -0700 2009
1
2
3
ssoper@caprica:~$ irb
irb(main):001:0> class Person
irb(main):002:1> def initialize
Gravatar
Wed Aug 12 12:18:22 -0700 2009
1
2
3
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
gist: 147871 Useful .bash_login
Gravatar
Wed Jul 15 11:15:54 -0700 2009
1
2
3
PS1="\u@\h:\w$ "
 
export CLICOLOR=1
gist: 129748 Add a tint to your UITabBar...
Gravatar
Sun Jun 14 09:53:07 -0700 2009
1
2
3
// Add a tint to your UITabBarController
 
// This goes in your implementation (.m) file
Gravatar
Tue May 05 11:23:10 -0700 2009
1
2
3
module OverwritePayflowAPI
  def self.included(base)
    base.alias_method_chain :commit, :retry
Gravatar
Tue May 05 11:22:08 -0700 2009
1
2
3
module OverwritePayflowAPI
  def self.included(base)
    base.alias_method_chain :commit, :retry
gist: 102873 SEOize any url
Gravatar
Mon Apr 27 18:41:43 -0700 2009
1
2
3
def set_url
  return true if url
  self.url = title.gsub(/'s/, '').gsub(/[^[:alnum:]\-\s\_]/, '').split(/[\s\-\_]+/).delete_if { |i| i.empty? }.join('-').downcase[0..25]
gist: 96629 All 50 states plus DC
Gravatar
Thu Apr 16 13:17:36 -0700 2009
1
2
3
  STATES = [
      [ "Alabama", "AL" ],
      [ "Alaska", "AK" ],
Gravatar
Wed Apr 08 20:28:54 -0700 2009
1
2
3
<html>
<head>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js'></script>
Gravatar
Wed Apr 08 20:23:25 -0700 2009
1
"_method=put&authenticity_token=0ba2a152cfbbec1054f94333b533d7d79753e635&tagging%5Bon%5D=business_type&tagging%5Blist%5D%5B%5D=acne&tagging%5Blist%5D%5B%5D=vitiligo&tagging%5Blist%5D%5B%5D=cancer+-+bladder"
gist: 23867 ghost class
Gravatar
Tue Nov 11 06:47:58 -0800 2008
1
2
3
irb(main):001:0> class Foo
irb(main):002:1> def ghost_class
 
gist: 23866 The ghost class! ...spooky
Gravatar
Tue Nov 11 06:47:56 -0800 2008
1
2
3
irb(main):001:0> class Foo
irb(main):002:1> def ghost_class
 
gist: 23509 Recipe for gluten-free panc...
Gravatar
Mon Nov 10 07:44:29 -0800 2008
1
2
3
1 cup gluten-free whole wheat (i recommend Bob's Red Mill)
2 tsp baking powder
1 tsp salt
Gravatar
Wed Oct 29 13:38:20 -0700 2008
1
2
3
$().ready(function() {
    // init file upload
    var uploadTimer;