Public Gists by bdotdub

Gravatar
Thu Nov 12 12:22:21 -0800 2009
1
2
3
# this is really silly
 
irb(main):035:0> hash = {:x => 'y'}
Gravatar
Wed Nov 04 17:53:14 -0800 2009
1
2
3
# Norc on Dreamhost
 
Norc is a Task Management System that replaces Unix cron developed by [Darrell Silver](http://darrellsilver.com/) for use at [Perpetually.com](http://www.perpetually.com/). Norc on Dreamhost gives you a basic template to get Norc up and running on Dreamhost.
gist: 215432 rebasing git branches
Gravatar
Wed Oct 21 13:31:45 -0700 2009
1
2
3
#!/bin/bash
 
# MAIN_BRANCH will use the first parameter or default to 'master'
Gravatar
Wed Jul 15 16:58:58 -0700 2009
1
2
3
#pragma mark UIWebViewDelegate methods
 
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType;
Gravatar
Tue Jul 14 20:58:49 -0700 2009
1
2
3
# Quickie shell script that will tell you how long your Mac has been asleep
 
ioreg -c IOHIDSystem | awk '/HIDIdleTime/ {print int($NF/1000000000); exit}'
Gravatar
Thu Jul 09 06:37:43 -0700 2009
1
2
3
- (id)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
  // Record the starting point
  UITouch *touch = [touches anyObject];
gist: 131064 Hoptoad notifier for Sinatra
Gravatar
Tue Jun 16 20:47:08 -0700 2009
1
2
3
error do
  exception = request.env['sinatra.error']
  Hoptoad::Notifier.send_error exception, params, request.env if %w(staging production).include?(ENV['RACK_ENV'])
Gravatar
Tue May 19 07:03:33 -0700 2009
1
2
3
(function($) {
 
  $.fn.konami = function(callback, code) {
gist: 108228 get the unique id of an iphone
Gravatar
Thu May 07 10:52:37 -0700 2009
1
NSString *id = [[UIDevice currentDevice] uniqueIdentifier];
gist: 107225 iPhone Obj-C code to use di...
Gravatar
Tue May 05 14:41:35 -0700 2009
1
2
3
/*
 * Author: Benny Wong - http://bwong.net/
 *
Gravatar
Wed Apr 15 15:34:51 -0700 2009
1
2
3
class Archiver
  def initialize(directory)
    @directory = directory
Gravatar
Fri Mar 27 15:05:11 -0700 2009
1
2
3
#!/usr/bin/ruby
 
require 'aws/s3'
gist: 70317 Equivalent?
Gravatar
Wed Feb 25 09:54:40 -0800 2009
1
2
3
filter(P, [H|T]) ->
  case P(H) of
    true -> [H|filter(P, T)];
Gravatar
Thu Feb 12 21:44:11 -0800 2009
1
2
3
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
Gravatar
Thu Feb 12 21:22:23 -0800 2009
1
2
3
function click(theFunction) {
  // Something happens
  theFunction(event);
gist: 45207 Comparison between perl and...
Gravatar
Fri Jan 09 10:15:55 -0800 2009
1
2
3
@tuples = sort { $a->[0] <=> $b->[0] } @tuples;
 
my $dates = map { $_->[0] } @tuples;
gist: 44276 Patch for Sinatra bug that ...
Gravatar
Wed Jan 07 05:26:26 -0800 2009
1
2
3
--- a/lib/sinatra.rb
+++ b/lib/sinatra.rb
@@ -1260,7 +1260,8 @@ module Sinatra
gist: 35516 Test page for patch http://...
Gravatar
Sat Dec 13 10:00:45 -0800 2008
1
2
3
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
Gravatar
Sat Dec 13 08:32:39 -0800 2008
1
2
3
@@ -95,8 +95,8 @@
   this._defaultFlashVersion = 8;
 
gist: 34078 Matching 'swf' at the end o...
Gravatar
Tue Dec 09 12:46:25 -0800 2008
1
2
3
497c497
< if (smURL.match(/.swf/)) {
---