Public Gists by timocratic

Gravatar
Fri Nov 20 16:53:57 -0800 2009
1
2
3
irb(main):001:0> :my_new_symbol.to_i
=> 16073
irb(main):002:0> 16073.to_sym
Gravatar
Tue Nov 17 11:51:06 -0800 2009
1
2
3
// DR1.0 :: domReady
// *****************************************************
// DOM scripting by brothercake -- http://www.brothercake.com/
gist: 222710 An example of differing way...
Gravatar
Fri Oct 30 13:49:33 -0700 2009
1
2
3
class AbstractScraper
  def initialize(username, password)
    @agent = WWW::Mechanize.new
Gravatar
Sun Oct 25 22:46:24 -0700 2009
1
2
3
#!/usr/bin/env ruby
#With thanks to http://tonybuser.com/post/188055319/importing-typo-to-tumblr for the initial seed
require "rubygems"
Gravatar
Thu Oct 08 18:29:07 -0700 2009
1
2
3
nesquena sent you a message.
 
--------------------
gist: 205565 Does a git pull, even with ...
Gravatar
Thu Oct 08 17:39:37 -0700 2009
1
2
3
gitup() {
  if git update-index --refresh; then
stashed=
Gravatar
Thu Oct 01 16:50:33 -0700 2009
1
2
3
#!/bin/sh
git filter-branch -f --env-filter '
ae=$GIT_AUTHOR_EMAIL
Gravatar
Thu Oct 01 16:49:07 -0700 2009

      
Gravatar
Sat Aug 08 14:27:47 -0700 2009
1
2
3
module FlexCompiler
  COMPILER = "/Applications/Adobe\\ Flex\\ Builder\\ 3/sdks/3.2.0/bin/mxmlc"
  FRAMEWORK_PARAM = "-runtime-shared-library-path=/Applications/Adobe\\ Flex\\ Builder\\ 3/sdks/3.2.0/frameworks/libs/framework.swc,framework_3.2.0.3958.swz,,framework_3.2.0.3958.swf"
Gravatar
Wed Jul 22 13:13:20 -0700 2009
1
2
3
module MethodVisibility
  #mocking out super calls is tricky, so here is a hack to get around it.
  def hide_method(method, replacement = Proc.new(){})
Gravatar
Fri Jul 03 16:05:55 -0700 2009
1
2
3
def funky_foo(shakalaka, &block)
  unless some_condition
    puts "chicken dinner"
Gravatar
Thu Jun 18 10:10:22 -0700 2009
1
2
3
unless defined?(TEST_ROOT)
  TEST_ROOT = File.expand_path(File.join(File.dirname(__FILE__),'..'))
  $LOAD_PATH.unshift(TEST_ROOT)
Gravatar
Fri Apr 17 15:05:19 -0700 2009
1
2
3
module Rack
  class Builder
    def use(middleware, *args, &block)
Gravatar
Fri Apr 03 11:36:59 -0700 2009
1
2
3
def assign_by_weight(weights)
  sum = weights.keys.inject(0) { |s,v| s += v }
  #normalize random over sum
gist: 87602 some git directory filtering
Gravatar
Sun Mar 29 19:02:40 -0700 2009
1
2
3
git filter-branch -f --subdirectory-filter 'directory' #promote
git filter-branch -f --index-filter 'git rm -r --cached --ignore-unmatch directory' HEAD #delete
#http://git.or.cz/gitwiki/GraftPoint
Gravatar
Wed Mar 18 14:00:20 -0700 2009
1
2
3
#Or just check-out: http://github.com/timocratic/test_benchmark/tree/master
#It's only one file too: http://github.com/timocratic/test_benchmark/blob/832b2217451b49ed218d2db31dfad2b81a2399eb/lib/test_benchmark.rb
#Go ahead and steal anything you want from it - or even better fork it and add what features you like
Gravatar
Tue Feb 24 15:12:33 -0800 2009
1
2
3
class RspecInTU
  class << self
    alias it define_method
gist: 67811 call irb from script context
Gravatar
Fri Feb 20 16:46:54 -0800 2009
1
2
3
#stolen from http://pastie.org/395671 twitter:@seacreature. Just repo'ed here so I can find it again
require "irb"
IRB.setup(nil)
gist: 51176 Quake 3 config file - put i...
Gravatar
Fri Jan 23 12:27:10 -0800 2009
1
2
3
set w1 "weapon 5; bind mouse3 vstr w2; echo ROCKET LAUNCHER"
set w2 "weapon 7; bind mouse3 vstr w1; echo RAIL GUN"
bind mouse3 vstr w1
Gravatar
Tue Jan 20 11:52:31 -0800 2009
1
2
3
test = Rake::Task['test']
test.clear
desc 'Run all units, functionals, integration, libs'