Skip to content

Instantly share code, notes, and snippets.

View stevepaulo's full-sized avatar

Steve Paulo stevepaulo

  • Underdog Fantasy
  • San Ramon, CA
  • 00:48 (UTC -08:00)
  • X @stevepaulo
View GitHub Profile
@stevepaulo
stevepaulo / chadwick.rake
Created October 23, 2020 20:06
Chadwick Bureau Register tasks for STOMPER Projections
namespace :chadwick do
desc "Download latest Chadwick Bureau Register"
task download: :environment do
sh "wget https://github.com/chadwickbureau/register/blob/master/data/people.csv?raw=true -O ./data/people.csv"
end
desc "Prepare Chadwick CSV for use in STOMPER"
task prep_csv: :environment do
input = "data/people.csv"
output = "data/chadwick.csv"
@stevepaulo
stevepaulo / update.sh
Created November 20, 2018 18:49
BASH script for updating all repos in a directory
#!/bin/bash
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
check_subdirs () {
curdir=`pwd`
for D in `find ${curdir} -type d -mindepth 1 -maxdepth 1`; do
if [ -d "${D}" ]; then
cd "${D}"
@stevepaulo
stevepaulo / countdown.sh
Created March 1, 2018 19:00
Countdown timer in terminal
MIN=10 && for i in $(seq $(($MIN*60)) -1 1); do printf "\r%02d:%02d:%02d" $((i/3600)) $(( (i/60)%60)) $((i%60)); sleep 1; done
@stevepaulo
stevepaulo / make_csv.sql
Last active May 29, 2018 17:05
Create CSV from MySQL output
INTO OUTFILE '/var/lib/mysql-files/orders.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n';

Keybase proof

I hereby claim:

  • I am stevepaulo on github.
  • I am stevepaulo (https://keybase.io/stevepaulo) on keybase.
  • I have a public key whose fingerprint is 0287 AAED 1CF4 CB8F B4B5 2A69 B28A 30BC 5CA2 28C6

To claim this, I am signing this object:

@stevepaulo
stevepaulo / wordlist.txt
Created August 14, 2015 18:25
Mnemonic word list for server names, release names, etc... solve the "hard problem" of naming things
From http://web.archive.org/web/20090918202746/http://tothink.com/mnemonic/wordlist.html
Word selection criteria:
- The wordlist contains 1626 words.
- All words are between 4 and 7 letters long.
- No word in the list is a prefix of another word (e.g. visit, visitor).
- Five letter prefixes of words are sufficient to be unique.
The rest of the criteria are less strict. You may find exceptions to all of them because it is difficult to satisfy them all at the same time.
- The words should be usable by people all over the world. The list is far from perfect in that respect. It is heavily biased towards western culture and English in particular. The international vocabulary is simply not big enough. One can argue that even words like "hotel" or "radio" are not truly international. You will find many English words in the list but I have tried to limit them to words that are part of a beginner's vocabulary or words that have close relatives in other european languages. In some cases a word has a different meaning
@stevepaulo
stevepaulo / find-and-replace
Created March 13, 2015 16:10
find and replace text in files, recursively, on Mac OSX
find . -type f -name '*.txt' -exec sed -i '' s/this/that/ {} +
@stevepaulo
stevepaulo / deepCopy.js
Last active June 20, 2017 18:11
deep copy JS object
let o1 = { p1: 'v1', p2: { p3: 'v3' }, p4: ['a', 'b', 'c'], p5: 1, p6: false, p7: null, p8: undefined };
function deepCopy(o) {
let o_copy = {}
for (var p in o) {
if (o.hasOwnProperty(p)) {
if (typeof o[p] === 'object' && !(Array.isArray(o[p]) || o[p] == null)) {
o_copy[p] = deepCopy(o[p]);
} else {
o_copy[p] = o[p]