I hereby claim:
- I am stantonk on github.
- I am stantonk (https://keybase.io/stantonk) on keybase.
- I have a public key whose fingerprint is 21AE 63EF 74EC 1D5D C904 98A8 1538 E2F1 20F5 28F9
To claim this, I am signing this object:
def date_xrange(s_dt, e_dt, inclusive=False): | |
ONE_DAY = timedelta(days=1) | |
days = (e_dt - s_dt).days | |
days = days + 1 if inclusive else days | |
return (s_dt + i*ONE_DAY for i in range(0, days)) |
package default; | |
import com.fasterxml.jackson.annotation.JsonProperty; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; | |
import com.google.common.base.Objects; | |
import com.google.common.collect.Lists; | |
import org.hibernate.validator.constraints.NotEmpty; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; |
# -*- coding: utf-8 -*- | |
from instagram.client import InstagramAPI | |
import time | |
access_token = "REDACTED" | |
api = InstagramAPI(access_token=access_token, client_id='REDACTED', client_secret='REDACTED') | |
media_id = 'REDACTED' | |
response = api.media(media_id=media_id) |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
#!/usr/bin/env python | |
""" | |
Note: requires numpy. `sudo pip install numpy` | |
Example: | |
$ echo -e "1\n2\n5\n10\n20\n" | get-stats | |
mean=7.6 | |
median=5.0 | |
std=6.94550214167 |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu/trusty64" |
I hereby claim:
To claim this, I am signing this object:
import re | |
import sys | |
# note, currently doesn't handle: | |
# Jun 29 00:00:03 host tag: message repeated 3 times: [ 192.168.1.1 - - "POST /api/someendpoint/ | |
r = re.compile(r'(\w{3,}\s+\d{2,}\s+\d{2,}:\d{2,}:\d{2,})\s+([\w-]+)\s+([\w-]+):\s+((\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3},?\s?)+)\s+-\s+-\s+\"(GET|POST|PUT|PATCH|HEAD|DELETE) ((\/[\w_]+)+)\/\??(.*) HTTP\/\d\.\d" (\d{3,}) (\d+|-)') | |
anonymizers = ( | |
(re.compile(r'(\d+,?)+'), 'id'), # one or more optionally csv separated ids |
// see: | |
// http://jdbi.org/fluent_queries/ | |
// http://www.jooq.org/doc/3.7/manual/getting-started/use-cases/jooq-as-a-standalone-sql-builder/ | |
// Your Java Bean | |
public static class Reminder { | |
private long id; | |
private long customerId; | |
public Reminder(long id, long customerId) { |
#!/usr/bin/env bash | |
################################################################################ | |
# Use as a global mercurial/git pre commit or pre push hook to detect the type | |
# of project and run unittests before allowing a commit or push to a remote | |
# repository. | |
# | |
# Handy so that you don't have to remember to add test running hooks to every | |
# repo clone/fork you have. | |
################################################################################ | |
echo "run-test-hooks executing..." |