Skip to content

Instantly share code, notes, and snippets.

View katylava's full-sized avatar
🐢

katy lavallee katylava

🐢
View GitHub Profile
@katylava
katylava / spndrinking.md
Last active October 7, 2015 12:48
Supernatural Drinking Game

Supernatural Drinking Game

BEWARE SPOILERS
This is for people re-watching the series.


Drink when:

primes = [
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67,
71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139,
149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223,
227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293,
307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383,
389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463,
467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569,
571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647,
653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743,
squares = [
(1, 1, 1), (2, 4, 3), (3, 9, 5), (4, 16, 7), (5, 25, 9), (6, 36, 11),
(7, 49, 13), (8, 64, 15), (9, 81, 17), (10, 100, 19), (11, 121, 21),
(12, 144, 23), (13, 169, 25), (14, 196, 27), (15, 225, 29), (16, 256, 31),
(17, 289, 33), (18, 324, 35), (19, 361, 37), (20, 400, 39), (21, 441, 41),
(22, 484, 43), (23, 529, 45), (24, 576, 47), (25, 625, 49), (26, 676, 51),
(27, 729, 53), (28, 784, 55), (29, 841, 57), (30, 900, 59), (31, 961, 61),
(32, 1024, 63), (33, 1089, 65), (34, 1156, 67), (35, 1225, 69),
(36, 1296, 71), (37, 1369, 73), (38, 1444, 75), (39, 1521, 77),
(40, 1600, 79), (41, 1681, 81), (42, 1764, 83), (43, 1849, 85),
@katylava
katylava / dates.md
Last active December 28, 2015 13:19

Datetimes and Timezones and DST, oh my!

This is an example of how to generate occurrences from python-dateutil's rrule module, and convert them properly to UTC before saving to the database, particularly if your input is localized to a timezone that observes daylight savings. This assumes your server time is localized, otherwise if it's UTC you probably won't run into these problems.

Note: US daylight savings in 2014 started on March 9

@katylava
katylava / es.sh
Created December 12, 2013 16:27
Install elasticsearch on Ubuntu 12/13
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.7.deb
sudo dpkg -i elasticsearch-0.90.7.deb
# Store data in /usr/local/var/mongodb instead of the default /data/db
dbpath = /usr/local/var/mongodb
# Append logs to /usr/local/var/log/mongodb/mongo.log
logpath = /usr/local/var/log/mongodb/mongo.log
logappend = true
# Only accept local connections
bind_ip = 127.0.0.1
@katylava
katylava / keybase.md
Created April 10, 2014 20:23
keybase.md

Keybase proof

I hereby claim:

  • I am katylava on github.
  • I am katylava (https://keybase.io/katylava) on keybase.
  • I have a public key whose fingerprint is A9CE F4F6 C2EE CA43 D9AE 7AC5 5C98 B583 35BF 056B

To claim this, I am signing this object:

#!/usr/bin/env bash
git remote prune origin;
for b in `git br --merged master | grep -v "^\s\+master$" | grep -v "^\*"`; do
git br -d $b;
done;
# gist git-cleanup -u 10907671
{
"browser": false,
"node": true,
"predef": ["after", "afterEach", "before", "beforeEach", "describe", "it" ],
"strict": false, // this should unnecessary -- default is false -- but seems to be enabled in some environments
// Katy
// enforcing options
// "camelcase": true, // require camelCase or ALL_UPPER -- this would be nice but we don't control all identifiers (e.g. the ones from jsforce)
@katylava
katylava / 1-tasks.css
Last active April 17, 2017 20:04
HabitRPG Stylish styles
body {
/*
background: url(http://subtlepatterns.com/patterns/skulls.png);
background: url(http://subtlepatterns.com/patterns/halftone.png);
background: url(http://i.imgur.com/6Vkqf2z.png); /* wood panel *//*
*/
background: url(http://i.imgur.com/1bBINau.png); /* green cup */
}