Skip to content

Instantly share code, notes, and snippets.

View benguillet's full-sized avatar

Ben Guillet benguillet

View GitHub Profile
[push]
default = simple
-- Always show how long a query takes
\timing
-- Auto extended display mode
\x auto
-- Prompt db_name@host
\set PROMPT1 '%/@%m %R%# '
@benguillet
benguillet / .gitconfig
Created July 18, 2013 18:40
Summary of your commit for Scrum standup.
[alias]
; Get a summary of yesterday commits. Useful for Scrum standup.
standup = "!git log --since yesterday --author `git config user.email` --pretty=short"
@benguillet
benguillet / mapper.js
Created June 26, 2013 21:37
Word count in Javascript with WebMapReduce (http://webmapreduce.sourceforge.net/).
// Javascript Mapper
function mapper(key, value) {
var words = key.split(' ');
for (var i = 0; i < words.length; ++i) {
Wmr.emit(words[i], '1');
}
}
@benguillet
benguillet / gist:5190447
Last active December 15, 2015 02:49
A Django gist to send a text file and launch a program on a different server
if request.method == 'POST':
if form.is_valid():
# write file in ~/hipercic/apps/dcor/jobs/
with open('apps/dcor/jobs/job_' + datetime.today().strftime("%Y%m%d_%H%M%S") + '_params.txt', 'w') as params_file:
for key, val in form.cleaned_data.iteritems():
params_file.write(str(val) + ' \n')
scp = 'scp /home/guillet/hipercic/' + params_file.name + ' guillet@helios.public.stolaf.edu:dcor/jobs/'
context['scp'] = scp
return_code_scp = subprocess.call(scp, shell=True)
@benguillet
benguillet / gist:5000604
Last active December 14, 2015 00:39 — forked from pithyless/gist:1208841

Install Python

$ brew install readline sqlite gdbm --universal
$ brew install python --universal --framework
$ python --version
Python 2.7.3

Symlinks...

@benguillet
benguillet / keybase.md
Last active August 29, 2015 14:21
Keybase Github Verification

Keybase proof

I hereby claim:

  • I am benguillet on github.
  • I am benjaminguillet (https://keybase.io/benjaminguillet) on keybase.
  • I have a public key whose fingerprint is 149C 194E F1FF FE6C 36C3 2F39 18C9 EBEB 2B8F 5E1D

To claim this, I am signing this object: