Public Gists by ivey

Gravatar
Mon Nov 30 18:06:28 -0800 2009
1
2
3
class User < TwitterAuth::GenericUser
  def twitter_oauth_client
    oauth = Twitter::OAuth.new(TwitterAuth.consumer.key,TwitterAuth.consumer.secret)
Gravatar
Tue Nov 10 17:20:35 -0800 2009
1
2
3
<ivey> New RT curiousity: @doesnothave doesn't have RT feature yet, and
       @doeshave, obviously, does. @doesnothave tweets something
       cool. @doeshave retweets. Does it show up in @doesnothave's
Gravatar
Fri Oct 30 14:00:52 -0700 2009
1
2
3
#!/usr/bin/env ruby
require 'rubygems'
 
Gravatar
Fri Oct 09 19:41:18 -0700 2009
1
2
3
irb(main):005:0> str = 'foo #{bar} baz'
=> "foo \#{bar} baz"
irb(main):006:0> bar = 2
Gravatar
Mon Sep 21 18:10:07 -0700 2009
1
2
3
(defun open-next-http-url ()
  "Search forward to the next http/https URL, and open it"
  (interactive)
Gravatar
Thu Aug 20 12:51:14 -0700 2009
1
2
3
;;; gist.el --- Emacs integration for gist.github.com
     
;; Copyright (C) 2008 Christian Neukirchen <purl.org/net/chneukirchen>
Gravatar
Wed Aug 19 22:05:35 -0700 2009
1
2
3
(defun depth-from-git-root ()
  (length (split-string
           (shell-command-to-string "git rev-parse --show-cdup")
Gravatar
Tue Aug 18 12:52:46 -0700 2009
1
2
3
Google Voice transcription of a wrong number. Google doesn't handle
heavy Southern accents well:
 
Gravatar
Wed May 06 19:48:18 -0700 2009
1
2
3
#!/usr/bin/env ruby
require 'rubygems'
 
Gravatar
Sun Mar 22 19:43:00 -0700 2009
1
2
3
du -sk . * | perl -e '$sum=<>;
     while (<>) {
       ($size, $inode)=split;
Gravatar
Sun Feb 22 07:23:28 -0800 2009
1
2
3
namespace :git do
  task :unpushed do
    ahead = `git log origin/#{branch}..#{branch} --pretty=oneline --abbrev-commit`
Gravatar
Mon Feb 16 23:16:11 -0800 2009
1
2
3
I assume you've played w/ mutli-tty by now, but if not, check it out.
 
alias emacs='/Applications/Emacs.app/Contents/MacOS/bin/emacsclient -t'
Gravatar
Mon Feb 02 19:32:29 -0800 2009
1
2
3
(defun butterfly ()
  "Use butterflies to flip the desired bit on the drive platter.
Open hands and let the delicate wings flap once. The disturbance
gist: 50004 Reply to: http://twitter.co...
Gravatar
Wed Jan 21 07:43:15 -0800 2009
1
2
3
# Here's the example from the book:
 
input = ''
Gravatar
Tue Jan 20 11:56:32 -0800 2009
1
2
3
require 'fileutils'
 
class Jekyll < Thor
Gravatar
Mon Jan 05 07:41:47 -0800 2009
1
2
3
# Copyright 2009 Michael Ivey, released to public domain
# Disqus guts lifted from http://github.com/squeejee/disqus-sinatra-importer/tree/master
# I wanted it to run from MySQL and command line, instead of a Sinatra app
Gravatar
Mon Dec 01 14:04:03 -0800 2008
1
2
3
(defun add-vendor-directories ()
  (interactive)
  (mapc '(lambda (dir)
Gravatar
Sun Nov 30 14:51:16 -0800 2008
1
2
3
require 'sinatra-merb'
 
# use_orm :datamapper
Gravatar
Wed Oct 29 14:20:04 -0700 2008
1
curl http://merbcamp.com/video 2>&1 |grep mp4|sed -e 's/.*href="/http:\/\/merbcamp.com/' -e 's/">.*//'|xargs -n 1 wget
Gravatar
Tue Oct 28 19:53:09 -0700 2008
1
2
3
def fetch_with_limits(uri_str, limit = 10)
  raise ArgumentError, 'HTTP redirect too deep' if limit == 0