View nightmare.md

What is a coder's worst nightmare?

Mick Stute, BS in CS, PhD work in Bioinformatics

This was mine:

Was hired by a psychologist to fix a program that seemed to have "strange output" written by one of his ex-grad students. It was a program that reads a data files, asks about 50 questions, does some calculations, and comes up with some score based on this PhD's research. It's on a research 3B2 at the university. He demonstrates the program and sure enough there seemed to be strange flashing words on the screen when it moves from question to question and they don't seem nice. I agree to do it, should be pretty straight forward, so he'll pay me by the hour to determine how big the fix is and then we'll agree to a fee.

Day 1

View gc.bash
1 2 3 4 5 6
# clone a github repo and then cd into it
function gc {
local repo=${1#*github.com/}
git clone "$repo" "$HOME/src/$repo"
cd "$HOME/src/$repo"
}
View gist:d89aa8bd47ae0c788024
1 2 3 4 5 6 7 8 9
### Keybase proof
 
I hereby claim:
 
* I am indirect on github.
* I am indirect (https://keybase.io/indirect) on keybase.
* I have a public key whose fingerprint is 53B5 BDD2 6623 41EB 2932 B002 509A E6D4 A089 D900
 
To claim this, I am signing this object:
View gist:c4c9f7fd34b08a8804e5
1 2 3 4 5 6 7 8 9
$ gem list --verbose -r
 
*** REMOTE GEMS ***
 
GET https://api.rubygems.org/latest_specs.4.8.gz
302 Moved Temporarily
GET https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz
200 OK
^CERROR: Interrupted
View safe_bundle_standalone.sh
1 2 3 4 5 6 7 8 9 10
#!/bin/bash
 
set -ex
bundle install --standalone
 
digest=$(md5 -q Gemfile)
cmd="raise \"Gemfile changed\" if %x[md5 -q Gemfile].chomp != \"${digest}\""
 
echo $cmd > bundle/bundler/setup.rb.new
cat bundle/bundler/setup.rb >> bundle/bundler/setup.rb.new
View less_than_proc.rb
1 2 3 4 5 6 7 8 9
class LessThanProc < Proc
attr_accessor :present
 
def self.with(present)
pv = Gem::Version.new(present.dup)
lt = self.new { |required| pv < Gem::Version.new(required) }
lt.present = present
return lt
end
View app.rb
1 2 3 4 5 6 7 8 9 10
require 'sinatra'
require 'zlib'
 
configure do
set :server, :puma
end
 
get '/text' do
body File.read("text")
end
View tmux-named
1 2 3 4 5 6 7 8 9 10
#!/bin/bash
 
# Set up paths and whatnot
test -e ~/.bashrc && source ~/.bashrc
 
# We need tmux. Obvs.
if [[ -z `which tmux` ]]; then echo "You need tmux first!"; exit 1; fi
 
# Named variables are much more flexible
name="$1"
View iterated_steps.coffee
1 2 3 4 5 6 7 8
casper = require('casper').create()
 
casper.start 'http://docs.casperjs.org/en/latest/', ->
createWeekStep = (weekNum, index, weeks) ->
@then -> console.log("running step for week #{weekNum}")
(i for i in [1..12]).forEach(createWeekStep, @)
 
casper.run()
View O_O.txt
1 2 3 4 5 6 7 8
On Mon, Mar 25, 2013 at 3:47 PM, <alexba...@googlemail.com> wrote:
> One thing that does confuse me, is how to specify a specific version of
> someones code? say, their v1.0 or a git commit hash
 
If you want to do this, the Best Practice method (currently) is to
fork their repo, and maintain your fork at the revision you need.
 
from https://groups.google.com/forum/#!topic/golang-nuts/t01qsI40ms4
Something went wrong with that request. Please try again.