Skip to content

Instantly share code, notes, and snippets.

View padwasabimasala's full-sized avatar
😃

Matthew Thorley padwasabimasala

😃
View GitHub Profile
@padwasabimasala
padwasabimasala / esv_ranges.py
Created September 24, 2018 03:00 — forked from eykd/esv_ranges.py
Data structure defining the number of verses in every chapter of every book of the ESV bible.
# list of books, padded with None to be 1-indexed
# each book is a tuple with name of book, # of chapters, [number of verses in each chapter]
# the list with the number of verses per chapter is padded to make it 1-indexed
passage_data = [None,
('Genesis', 50, [None, 31, 25, 24, 26, 32, 22, 24, 22, 29, 32, 32, 20, 18, 24, 21, 16, 27, 33, 38, 18, 34, 24, 20, 67, 34, 35,
46, 22, 35, 43, 55, 32, 20, 31, 29, 43, 36, 30, 23, 23, 57, 38, 34, 34, 28, 34, 31, 22, 33, 26]),
('Exodus', 40, [None, 22, 25, 22, 31, 23, 30, 25, 32, 35, 29, 10, 51, 22, 31, 27, 36, 16, 27, 25, 26, 36, 31, 33, 18, 40, 37, 21,
43, 46, 38, 18, 35, 23, 35, 35, 38, 29, 31, 43, 38]),
('Leviticus', 27, [None, 17, 16, 17, 35, 19, 30, 38, 36, 24, 20, 47, 8, 59, 57, 33, 34, 16, 30, 37, 27, 24, 33, 44, 23, 55, 46, 34]),
('Numbers', 36, [None, 54, 34, 51, 49, 31, 27, 89, 26, 23, 36, 35, 16, 33, 45, 41, 50, 13, 32, 22, 29, 35, 41, 30, 25, 18, 65,
@padwasabimasala
padwasabimasala / postgres-cheatsheet.md
Created May 10, 2017 23:13 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

If run with -E flag, it will describe the underlaying queries of the \ commands (cool for learning!).

Most \d commands support additional param of __schema__.name__ and accept wildcards like *.*

# DRAFT - Event Publishing Spec
The purpose of this doc is to define some simple guidelines for event publishing to be used on our teams
## Why publish events?
## What is a domain?
## Queue Names
environment . product/dept . domain . eventType
@padwasabimasala
padwasabimasala / wall-test.sh
Last active August 29, 2015 14:13
test vision wall feed
HOST=${1-https://vision.appreciatehub.com}
API=$HOST/api
if test -z $CLIENT_ID || test -z $CLIENT_SECRET; then
echo CLIENT_ID or CLIENT_SECRET not set in the ENV >&2
exit 1
fi
parse() {
jq $1 |sed -e 's/"//g'
@padwasabimasala
padwasabimasala / gist:603e9e92f977f18abbc0
Created May 28, 2014 21:41
Git Post Commit Hook to build JRuby Rails App
#!/bin/bash
export PATH='/home/git/jruby-1.7.11/bin':$PATH
webapps=/opt/tomcat_ruby/webapps
base=/home/git/passport
repo=$base/passport.git
latest_commit=$(cd $repo && git log --pretty=oneline -n1 |cut -d' ' -f1)
build_dir=$base/builds/$latest_commit
function run {
@padwasabimasala
padwasabimasala / coffee-init
Last active August 29, 2015 13:58
Quickly Bootstrap a Tiny Coffeescript App with Mocha and Should
#!/bin/bash
init() {
mkdir $name
cd $name
echo "{\"name\": \"$name\"}" > package.json
npm install --save coffee-script
}
@padwasabimasala
padwasabimasala / gist:9903284
Created March 31, 2014 21:59
Post Receive Hook to Build Jruby Apps
require 'logger'
class Builder
attr :base_dir, :repo, :build_dir, :log
def initialize(dir)
@base_dir = File.expand_path dir
@repo = File.join base_dir, "#{base_dir.split(File::SEPARATOR).last}.git"
@build_dir = File.join base_dir, 'builds', latest_commit
@log = Logger.new STDERR #File.join @base_dir, 'build.log'
@padwasabimasala
padwasabimasala / gist:9744878
Last active August 29, 2015 13:57
Node Notes
Modular Express Setup with CoffeeScript
https://gist.github.com/padwasabimasala/9744843
Test Express with Supertest
https://github.com/visionmedia/supertest
Mocha & CoffeeScript Setup
express = require 'express'
app = express();
# Configure
require('./config')(app)
# Routes
require('./routes')(app)
module.exports = app
101687767
101808423
102049377
102570381
102802964
102820901
102843596
103045972
103088787
103106751