Skip to content

Instantly share code, notes, and snippets.

View arowla's full-sized avatar

Alison Rowland arowla

  • Stitch Fix
  • Chicagoland, USA
View GitHub Profile
@arowla
arowla / .vimrc
Created March 3, 2010 23:27
My .vimrc file
set ai
set backspace=2 " (bs) allow backspacing over everything in insert mode
set expandtab
set foldmethod=indent
set hidden
set history=50 " (hi) keep 50 lines of command line history
set ignorecase
set incsearch
set laststatus=2
set list listchars=tab:>-,trail:.,extends:>,precedes:<
SELECT table_schema, table_name FROM information_schema.columns WHERE column_name LIKE '%name%';
from django.db import models
import uuid
class UUIDField(models.CharField):
"""
A field which stores a UUID value in hex format. This may also have
the Boolean attribute 'auto' which will set the value on initial save to a
new UUID value (calculated using the UUID1 method). Note that while all
UUIDs are expected to be unique we enforce this with a DB constraint.
if exists('+autochdir')
set autochdir
else
autocmd BufEnter * silent! lcd %:p:h:gs/ /\\ /
endif
@arowla
arowla / p-timer.sh
Created June 21, 2011 15:03
Pomodoro timer
# From http://navaneethkn.wordpress.com/2010/12/19/simple-egg-timer-on-linux-for-pomodoro-technique/
#!/bin/bash
counter=0
limit=$1
summary=$2
startmessage=$3
endmessage=$4
notify-send -u critical -i appointment -t 600 "$summary" "$startmessage"
echo
while [ $counter != $limit ]; do
@arowla
arowla / vim: surround macros
Created March 28, 2012 01:34
Surround visual selection with character (vim)
"surround visual selection with paired characters of your choice
vnoremap _( <ESC>`>a)<ESC>`<i(<ESC>
vnoremap _" <ESC>`>a"<ESC>`<i"<ESC>
vnoremap _' <ESC>`>a'<ESC>`<i'<ESC>
vnoremap _{ <ESC>`>a}<ESC>`<i{<ESC>
vnoremap _[ <ESC>`>a]<ESC>`<i[<ESC>
@arowla
arowla / gist:5578959
Created May 14, 2013 19:53
Comparison of FEC reports-- at top are a sample of ones where our (separately reported) itemized indiv. contribs exceed the campaign's reported individual contribs, and below are ones where only the (separately reported) itemized indiv. contribs PLUS the campaign's reported individual contribs exceed the campaign's reported total receipts. This …
datacommons=> select * from tmp_fec_total_receipts where total_itemized_contributions > total_individual_contributions limit 15;
candidate_id | committee_id | candidate_name | chamber | total_receipts | total_individual_contributions | total_itemized_contributions | last_summary_date
--------------+--------------+-------------------------+---------+----------------+--------------------------------+------------------------------+-------------------
H0AR01125 | C00480905 | SMITH, PRINCELLA D | H | 477.27 | 57.26 | 420.00 | 2012-12-31
H0AR02149 | C00477380 | ADAMS, JOHN | H | 730.71 | 0.00 | 730.00 | 2011-10-15
H0AZ03305 | C00468686 | HULBURD, JON | H | 13500.00 | 0.00 | 13500.00 | 2012-03-31
H0AZ04501 | C00485995 | PENA
#!/usr/bin/env node
//please requist your app token from
//https://trello.com/1/connect?key=yourkey&name=git-hook&expiration=never&response_type=token&scope=read,write
var key = "your key";
var token = "your token";
//https://trello.com/board/-/4e9003324a517dad44465056
var board_id = "4e9003324a517dad44465056";
var Trello = require("node-trello");
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Sample template to bring up Puppet Master instance that can be used to bootstrap and manage Puppet Clients. The Puppet Master is populated from an embedded template that defines the set of applications to load. **WARNING** This template creates one or more Amazon EC2 instances. You will be billed for the AWS resources used if you create a stack from this template.",
"Parameters": {
"InstanceType": {
"Description": "EC2 instance type for PuppetMaster",
"Type": "String",
"Default": "t1.micro",
"AllowedValues": [
"t1.micro",
@arowla
arowla / puppetmaster.sh
Last active August 29, 2015 13:57
Setting up Puppet on EC2. http://davidwinter.me/articles/2012/12/08/setting-up-puppet-master-and-agents-on-ec2/ was very helpful, but I had to make a few modifications to the files to get them to work.
#!/bin/bash
# This is the user-data script for EC2. It still didn't work as a user-data script,
# but once uploaded to the new server and then executed, it worked.
set -e -x
EC2_HOSTNAME=<put master hostname here>
export DEBIAN_FRONTEND=noninteractive
hostname $EC2_HOSTNAME
echo $EC2_HOSTNAME > /etc/hostname
wget https://apt.puppetlabs.com/puppetlabs-release-precise.deb
dpkg -i puppetlabs-release-precise.deb