Skip to content

Instantly share code, notes, and snippets.

# There is precious little documentation on how to use Grit to add files
# to a repository. Basically as far as I understand it the steps are:
#
# (1) Create a repository via 'git init' on the command line
# (2) Create a Grit::Repo object
# (3) Write one or more files to the directory the repository lives in
# (4) Create Grit::Blob objects that represent those files
# (5) Add the files to the index
# (6) Commit the index
; <<>> DiG 9.5.0-P2 <<>> de.wowwiki.wikia.com @ns1.wikia.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4702
;; flags: qr aa rd; QUERY: 1, ANSWER: 2, AUTHORITY: 4, ADDITIONAL: 4
;; WARNING: recursion requested but not available
;; QUESTION SECTION:
;de.wowwiki.wikia.com. IN A
# Taken from the Makefile.PL from Mark Jason Dominus' Memoize.pm
# (http://search.cpan.org/~mjd/Memoize-1.01/Memoize.pm)
#
# ===============================================================================
use ExtUtils::MakeMaker;
#
# I've reneged on the following threat:
#
# ruby 1.9.3 was released today. One of the notes in the NEWS file says
#
# * yaml
# * The default YAML engine is now Psych. You may downgrade to syck by setting
# YAML::ENGINE.yamler = 'syck'.
#
# I assumed that psych would be faster than syck, so I ran a test. timeline.yml is
# 984K of twitter timeline json converted to yaml.
require 'yaml'
+ . /home/paulv/.rvm/scripts/rvm
++ export HOME rvm_prefix rvm_user_install_flag rvm_path
++ HOME=/home/paulv
++ : rvm_stored_umask:0022
++ (( 0 == 0 ))
++ for rvmrc in /etc/rvmrc '"$HOME/.rvmrc"'
++ [[ -f /etc/rvmrc ]]
++ for rvmrc in /etc/rvmrc '"$HOME/.rvmrc"'
++ [[ -f /home/paulv/.rvmrc ]]
++ grep '^\s*rvm .*$' /home/paulv/.rvmrc
+ : 1 > . /home/paulv/.rvm/scripts/rvm
++ /scripts/rvm : 8 > export HOME rvm_prefix rvm_user_install_flag rvm_path
++ /scripts/rvm : 9 > HOME=/home/paulv
++ /scripts/rvm : 11 > : rvm_stored_umask:0022
++ /scripts/rvm : 12 > (( 0 == 0 ))
++ /scripts/rvm : 14 > for rvmrc in /etc/rvmrc '"$HOME/.rvmrc"'
++ /scripts/rvm : 16 > [[ -f /etc/rvmrc ]]
++ /scripts/rvm : 14 > for rvmrc in /etc/rvmrc '"$HOME/.rvmrc"'
++ /scripts/rvm : 16 > [[ -f /home/paulv/.rvmrc ]]
++ /scripts/rvm : 18 > grep '^\s*rvm .*$' /home/paulv/.rvmrc
ruby-mode 1.1 indents the following code like this
if true
val = string.split(/=/)
puts val
end
The puts line should be indented so that it matches the val line.
If you look at line 522 of ruby-mode.el (version 1.1, from elpa, I suspect other versions have the same code at possibly different line numbers) it says
@paulv
paulv / urinal_etiquette.rb
Created February 22, 2012 01:00 — forked from st23am/urinal_etiquette.rb
Test Problem
# Paul Visscher and Josh Mills
require 'rspec/given'
class BathroomEtiquette
def initialize(stalls, line)
@stalls = stalls
@line_exists = line
@stalls_hash = make_stalls_hash(stalls)
end
1. 192.168.11.1 0.0% 6 0.9 0.9 0.9 1.1 0.1
2. 10.167.0.1 0.0% 6 8.3 9.8 8.3 13.2 1.8
3. ae0-1000.cr02.blasohdp.swo.rr.com 0.0% 6 11.7 16.6 10.2 42.4 12.6
4. ae1.tr00.clmkohpe.mwrtn.rr.com 0.0% 6 14.2 14.0 12.3 14.9 1.1
5. ae-9-0.cr0.chi30.tbone.rr.com 0.0% 6 26.2 25.9 24.6 27.0 0.9
6. 107.14.17.147 0.0% 6 26.7 25.7 24.4 27.4 1.2
7.
@paulv
paulv / clock.rb
Created April 18, 2012 00:01 — forked from jimweirich/abstract.md
Berlin Clock Kata
# Paul Visscher and Greg Mefford
require 'rspec/given'
require 'time'
class BerlinClock
def self.convert_time(time)
t = Time.parse(time)
clock = ""