Skip to content

Instantly share code, notes, and snippets.

View lo5an's full-sized avatar

Logan Cox lo5an

View GitHub Profile
@lo5an
lo5an / gist:7547745
Last active December 28, 2015 19:09

Keybase proof

I hereby claim:

  • I am lo5an on github.
  • I am lo5an (https://keybase.io/lo5an) on keybase.
  • I have a public key whose fingerprint is 0D39 1707 EE6C A97C B8AF 6831 4899 5631 7AD4 E3F8

To claim this, I am signing this object:

; This file was auto-generated by drush make
core = 7.x
api = 2
projects[drupal][version] = "7.34"
; Modules
projects[addressfield][version] = "1.0-beta5"
projects[admin_menu][version] = "3.0-rc4"
@lo5an
lo5an / Vagrantfile
Last active August 29, 2015 14:17
~/vagrant.d/Vagrantfile to add package caching and dns for all vms
Vagrant.configure(2) do |config|
# configure a private network so that we can use NFS with caching
config.vm.network "private_network", type: "dhcp"
if Vagrant.has_plugin?("vagrant-cachier")
# Configure cached packages to be shared between instances of the same base box.
# More info on http://fgrehm.viewdocs.io/vagrant-cachier/usage
config.cache.scope = :box
#!/bin/bash
echo ""
echo " $* "
echo ""
read -p "Are you sure that you're not being dumb? (y/n)" $CONFIRM
if [ "$CONFIRM" == "y" ]
then
#!/bin/bash
1>&2 printf "\n $@ \n\n"
1>&2 read -p "Are you sure that you're not being dumb? (y/n)" CONFIRM
if [ "$CONFIRM" == "y" ]
then
/usr/bin/sudo "$@"
fi
@lo5an
lo5an / less.sh
Last active January 26, 2016 20:19
bashrc snippet to colorize less.
# use pygments to colorize less output
# http://pygments.org/docs/cmdline/
# requires pygments, obviously
PYGMENTS_FILTER="pygmentize"
if which $PYGMENTS_FILTER > /dev/null ; then
LESSPIPE="`which $PYGMENTS_FILTER` -f terminal"
export LESSOPEN="| ${LESSPIPE} %s"
export LESS='-R'
@lo5an
lo5an / hosts
Last active January 27, 2016 18:08
vagrant stuff to run ansible playbooks against
default ansible_ssh_host=drupal.vm.test ansible_ssh_user=vagrant ansible_ssh_private_key_file=.vagrant/machines/default/virtualbox/private_key
%matplotlib inline
import numpy
import matplotlib.pyplot
data = numpy.loadtxt(fname="inflammation-01.csv", delimiter=',')
fig = matplotlib.pyplot.figure(figsize=(10.0, 3.0))
import json
import csv
with open("authors.json") as authors_json, open("authors.csv", "w+") as authors_csv:
authordata = json.load(authors_json)
authorwriter = csv.writer(authors_csv, delimiter=',',
quotechar='"', quoting=csv.QUOTE_ALL)
for authoruri, value in authordata.items():
row=[]
row.append(authoruri[26:-5]) # id from uri