Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View zspencer's full-sized avatar

Zee zspencer

View GitHub Profile
[alias]
# Prints merged branches without the current working branch and mainline branches
extraneous-branches = "!f() { git branch --merged | grep -v -e 'gh-pages' -e 'master' -e 'staging' -e 'production'; }; echo `f`"
# Deletes the extraneous branches with a soft -d
remove-extraneous-branches = "!f() { git extraneous-branches; }; git branch -d `f`"
reb = remove-extraneous-branches
[vagrant@localhost ~]$ docker run -v /project:/project -ti centos:centos7 bash -l
[root@8f52d208561c /]# cd /project
[root@8f52d208561c project]# ls
[root@8f52d208561c project]# exit
logout
[vagrant@localhost ~]$ sudo service docker restart
Redirecting to /bin/systemctl restart  docker.service
[vagrant@localhost ~]$ doc^C
[vagrant@localhost ~]$ docker run -v /project:/project -ti centos:centos7 bash -l
@zspencer
zspencer / pro-engineering-2015-01-22-notes.md
Created January 23, 2015 04:18
Notes/Kata from CodeUnion Pro-engineering session 2015-01-22

Agenda: 6:00 ~ 6:10 - Review of last session concepts (TDD, Refactoring, 4 Rules of Simple Design) 6:10 ~ 7:00 - Mob programming on the Roman Numerals Kata, swapping drivers every 15m 7:00 ~ 7:05 - Break! 7:05 ~7:55 - Mob-programming on Roman Numerals Kata, swapping drivers ever 15m 7:55 ~ 8:00 - Reflect! How is our mental model of programming sharper at the end of the session than at the beginning?

Notes!

require 'rspec'
require 'securerandom'
describe("Roman numeral conversion") do
def expect_numeral_to_become_number(numeral,number)
expect(convert_numeral(numeral)).to(eql(number))
end
it "should return 1 for I" do
@zspencer
zspencer / partial.js
Last active August 29, 2015 14:13
So, you want to define partials in javascript, eh?
// Given a function and a set of arguments, returns a function that, when called,
// uses the originally given arguments as well as the new arguments. Heavily inspired by
// Clojure: https://clojuredocs.org/clojure.core/partial
//
// Example:
// > function logger() { console.log(arguments); }
// > var prefixedLogger = partial("hi", "there);
// > prefixedLogger("mom");
// { '0': 'hi', '1': 'there', '2': 'mom' }
function partial(fn, others) {
@zspencer
zspencer / .gitconfig
Last active April 6, 2016 00:17
git remove-extraneous-branches
[alias]
# Prints merged branches without the current working branch and mainline branches
extraneous-branches = "!f() { git branch --merged | grep -v -e 'gh-pages' -e 'master' -e 'staging' -e 'production'; }; echo `f`"
# Deletes the extraneous branches with a soft -d
remove-extraneous-branches = "!f() { git extraneous-branches; }; git branch -d `f`"
reb = remove-extraneous-branches
(defn inc-all []
(let [x '(1,2,3)]
(println (map inc x))
(println x)))
(inc-all)
@zspencer
zspencer / game_of_life.rb
Created October 10, 2013 19:46
Conways Game of Life
class Judge
def cast_judgement(cell)
if cell.neighbor_count < 2 || cell.neighbor_count > 3
cell.kill!
end
end
end
class Cell
[zee@prime ~]$ sudo salt 'hedgehog.makeheadspace.com' grains.items
hedgehog.makeheadspace.com:
cpu_flags: fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pse36 clflush mmx fxsr sse sse2 syscall nx lm rep_good unfair_spinlock pni vmx cx16 popcnt hypervisor lahf_lm
cpu_model: QEMU Virtual CPU version 1.0
cpuarch: x86_64
defaultencoding: None
defaultlanguage: None
domain: makeheadspace.com
fqdn: hedgehog.makeheadspace.com
gpus:
@import "susy";
$total-columns: 12;
$column-width: 4em;
$gutter-width: 1em;
$grid-padding: $grid-padding;
body {
font-family: Helvetica, sans-serif;
background-image: image-url('gray_jean.png');