Skip to content

Instantly share code, notes, and snippets.

View nessamurmur's full-sized avatar

Nessa Jane Marin nessamurmur

View GitHub Profile
@nessamurmur
nessamurmur / PR
Last active January 2, 2016 09:29
Barely modified hack & ship scripts
#!/bin/sh -x
CURRENT=`git branch | grep '\*' | awk '{print $2}'`
git checkout master
git pull origin master
git checkout ${CURRENT}
git rebase master
git push -u origin ${CURRENT}
hub pull-request
@nessamurmur
nessamurmur / .ruby-gemset
Created January 15, 2014 20:00
example ruby version management
example-project
#!/usr/bin/env escript
% -*- mode: erlang -*-
main([BeamFile]) ->
{ok,{_,[{abstract_code,{_,AC}}]}} = beam_lib:chunks(BeamFile,[abstract_code]),
io:fwrite("~s~n", [erl_prettypr:format(erl_syntax:form_list(AC))]).
@nessamurmur
nessamurmur / copy.rb
Created May 16, 2014 16:01
Copy postgres table to local storage without superuser
conn = ActiveRecord::Base.connection.raw_connection
tempfile = "/tmp/users.csv"
buff = ''
conn.transaction do
conn.exec( "COPY users TO STDIN AS CSV" )
File.open(tempfile, "wb") do |file|
file << buff while buff = conn.get_copy_data
end
end
@nessamurmur
nessamurmur / chess_piece.elm
Last active August 29, 2015 14:03
Updating Records in Elm
data Color = Black | White
data Piece = Pawn | Knight | Bishop | Rook | Queen | King
blackQueen = { color=Black, piece=Queen }
-- { color = Black, piece = Queen } : {color : Color, piece : Piece}
-- instantiating the record creates functions to return it's attributes:
.color blackQueen
-- Black : Color
@nessamurmur
nessamurmur / head_tail.rb
Created July 6, 2014 10:11
Spliting head from tail
a = [1,2,3,4,5]
# => [1, 2, 3, 4, 5]
head, *tail = a
# => [1, 2, 3, 4, 5]
head
# => 1
tail
# => [2, 3, 4, 5]
#!/usr/bin/env bash
#
# JBoss standalone control script
#
# chkconfig: - 80 20
# description: JBoss AS Standalone
# processname: standalone
# pidfile: /var/run/jboss-as/jboss-as-standalone.pid
# config: /etc/jboss-as/jboss-as.conf
description "This is an upstart job file for Immutant"
pre-start script
bash << "EOF"
mkdir -p /var/log/immutant
chown -R immutant /var/log/immutant
EOF
end script
# Ubuntu doesn't yet emit the network-services event:
@nessamurmur
nessamurmur / keybase.md
Created October 8, 2014 19:25
keybase.md

Keybase proof

I hereby claim:

  • I am niftyn8 on github.
  • I am nifty (https://keybase.io/nifty) on keybase.
  • I have a public key whose fingerprint is E748 00DB 4F69 2879 DDC7 A260 24CB 0368 3834 CF8C

To claim this, I am signing this object:

@nessamurmur
nessamurmur / onename.txt
Created October 10, 2014 23:29
onename
Verifying that +niftyn8 is my Bitcoin username. https://onename.io/niftyn8