Skip to content

Instantly share code, notes, and snippets.

Avatar

Nathan Witmer zerowidth

View GitHub Profile
@zerowidth
zerowidth / resources.md
Created Mar 10, 2014
Resources for learning git and GitHub
View resources.md

Learning git and GitHub

Tutorial videos

We have an excellent training team at GitHub, and they've produced a series of videos talking about the basics of how to use git and GitHub.

The youtube channel is here.

GitHub guides

@zerowidth
zerowidth / animation.rb
Last active Aug 29, 2015
Rendering animations as combinations of frame generators
View animation.rb
# A demonstration/exploration of generating animation "frames" by combining
# objects that emit sequences of frames, with the following goals:
#
# * Declarative syntax for convenience and readability
# * Composability, for easily assembling larger animations from smaller pieces
# * Interruptability (see Flagged), so an animation sequence can be interrupted
# * Lazily-evaluated combinations so clock-based animations can be mixed.
# A top-level animation.
class Animation
@zerowidth
zerowidth / blink.c
Created Feb 16, 2015
minimal blink in avr
View blink.c
View hundreds.rb
# From https://blog.svpino.com/2015/05/07/five-programming-problems-every-software-engineer-should-be-able-to-solve-in-less-than-1-hour
# Write a program that outputs all possibilities to put + or - or nothing
# between the numbers 1, 2, ..., 9 (in this order) such that the result is
# always 100. For example: 1 + 2 + 34 – 5 + 67 – 8 + 9 = 100.
# Hacky version:
["", "+", "-"].repeated_permutation(8).each do |operations|
string = (2..9).zip(operations).reduce("1") do |str, (operand, operator)|
"#{str}#{operator}#{operand}"
end
View rubygems_debug.diff
--- /opt/local/lib/ruby/site_ruby/1.8/rubygems.rb 2008-12-07 13:54:11.000000000 -0700
+++ /opt/local/lib/ruby/site_ruby/1.8/rubygems.rb 2008-12-07 13:54:11.000000000 -0700
@@ -128,6 +128,10 @@
# Gem::Requirement and Gem::Version documentation.
def self.activate(gem, *version_requirements)
+ if ENV["GEM_DEBUG"]
+ STDERR.puts "activating #{gem} #{version_requirements.inspect}"
+ caller[2..-1].each {|c| STDERR.puts " #{c}"}
+ end
View .profile
function d() {
if [ -n "$1" ]; then
if [ -d "$1" ]; then
pushd $1 >/dev/null
mvim -c :NT
popd >/dev/null
else
echo "$1 is not a directory"
fi
else
View gist:43974
require "ostruct"
describe "wtf" do
it "fails" do
o = OpenStruct.new :foo => "lol", :bar => "what"
o.stub!(:gem)
o.gem
o.gem "foo"
end
end
View gist:80128
~ ➔ sudo easy_install simplejson
Password:
Searching for simplejson
Reading http://pypi.python.org/simple/simplejson/
Reading http://undefined.org/python/#simplejson
Best match: simplejson 2.0.9
Downloading http://pypi.python.org/packages/source/s/simplejson/simplejson-2.0.9.tar.gz#md5=af5e67a39ca3408563411d357e6d5e47
Processing simplejson-2.0.9.tar.gz
Running simplejson-2.0.9/setup.py -q bdist_egg --dist-dir /tmp/easy_install-Irpzrr/simplejson-2.0.9/egg-dist-tmp-T_rpGb
No eggs found in /tmp/easy_install-Irpzrr/simplejson-2.0.9/egg-dist-tmp-T_rpGb (setup script problem?)
View mvim
#!/bin/sh
#
# This shell script passes all its arguments to the binary inside the
# MacVim.app application bundle. If you make links to this script as view,
# gvim, etc., then it will peek at the name used to call it and set options
# appropriately.
#
# Based on a script by Wout Mertens and suggestions from Laurent Bihanic. This
# version is the fault of Benji Fisher, 16 May 2005 (with modifications by Nico
# Weber and Bjorn Winckler, Aug 13 2007).
View .gvimrc
" size the window so it fills the macbook screen
set columns=181
set lines=53
set gfn=Andale_Mono:h12
" colorscheme twilight2
colorscheme vibrantink
set transparency=5