Public Gists by levinalex

gist: 228213 wikipedia2git.rb
Gravatar
Fri Nov 06 11:37:51 -0800 2009
1
2
3
require 'httparty'
require 'grit'
require 'pathname'
Gravatar
Thu Oct 08 11:18:51 -0700 2009
1
2
3
require 'json'
 
# takes a JSON object, removes specified subtrees and trims arrays
Gravatar
Wed Sep 09 09:57:36 -0700 2009
1
2
3
# demonstrates that fixtures are not cleaned after unit tests are run (or between different unit tests)
 
# setup a fresh rails project
Gravatar
Mon Aug 31 07:34:02 -0700 2009
1
2
3
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
 
Gravatar
Wed Jul 08 07:52:34 -0700 2009
1
2
3
#
# bash completion support for core Git.
#
Gravatar
Tue Jun 23 12:02:36 -0700 2009
1
2
3
def foo(*args)
  p args
end
Gravatar
Tue Jun 02 01:38:56 -0700 2009
1
2
3
# this is an ugly hack
 
When /^the spinx index is updated$/ do
Gravatar
Sat May 30 13:47:12 -0700 2009
1
2
3
#!/usr/bin/env ruby
 
require 'rubygems'
Gravatar
Wed Apr 29 10:00:39 -0700 2009
1
2
3
class Object
  def if_empty
    yield if empty?
Gravatar
Wed Apr 22 05:12:25 -0700 2009
1
2
3
  task :rebuild_config => :app_env do
    config = ThinkingSphinx::Configuration.instance
    file config.config_file do |f|
Gravatar
Thu Apr 16 10:55:59 -0700 2009
1
2
3
Postgres: 8.3.5
Ruby: 2.3.2
Postgres-Adapter: pg (0.8.0)
Gravatar
Tue Apr 14 15:56:22 -0700 2009
1
2
3
#!/usr/bin/env ruby
#
# written while macports compiles gnome stuff in order to install ffmpeg
Gravatar
Tue Apr 07 10:34:27 -0700 2009
1
2
3
$ irb
>> class Foo
>> def self.bob=(v)
Gravatar
Tue Mar 03 06:18:29 -0800 2009
1
2
3
module Enumerable
  def build_hash
    inject({}) do |h,elem|
Gravatar
Mon Feb 23 13:23:42 -0800 2009
1
2
3
#!/usr/bin/env ruby
#
# say a random word from the dictionary at least every ~n seconds
Gravatar
Fri Feb 13 10:19:03 -0800 2009
1
2
3
#!/usr/bin/env ruby
#
# burning_down_lighthouse
Gravatar
Thu Jan 29 03:53:21 -0800 2009
1
2
3
>> Foo = 3
=> 3
>> class Bar; end
Gravatar
Thu Jan 29 02:29:26 -0800 2009
1
2
3
#!/bin/bash
#
# some oddities with rails constant lookup
Gravatar
Thu Jan 22 08:53:30 -0800 2009
1
2
3
# print a sorted list of all classes in the ruby vm sorted by count
#
def object_statistics(minimum = 2)
Gravatar
Sun Jan 18 10:34:01 -0800 2009
1
2
3
#
# Rubyquiz #65 (Splitting the Loot)
# Levin Alexander <levin@grundeis.net>