Skip to content

Instantly share code, notes, and snippets.

View srhopkins's full-sized avatar

Steven Hopkins srhopkins

View GitHub Profile
@shieldsd
shieldsd / euler18.py
Created March 22, 2012 09:34
Project Euler #18
tn = [
[75],
[95,64],
[17,47,82],
[18,35,87,10],
[20, 4,82,47,65],
[19, 1,23,75, 3,34],
[88, 2,77,73, 7,63,67],
[99,65, 4,28, 6,16,70,92],
[41,41,26,56,83,40,80,70,33],
@kesor
kesor / graphite_magic
Last active December 18, 2015 09:19
Graphite deviation from average of last couple of weeks
target=diffSeries(
app.important.stuff,
averageSeries(
timeShift(app.important.stuff, "-7d"),
timeShift(app.important.stuff, "-14d"),
timeShift(app.important.stuff, "-21d")
)
)
@jorke
jorke / ses.ps1
Created October 8, 2013 03:53
Send email via AWS SES using powershell one liner.
Send-MailMessage -From <from> -to <to> -subject <subject> -SmtpServer email-smtp.us-east-1.amazonaws.com -Credential
$(New-Object System.Management.Automation.PSCredential -argumentlist <AWS_ACCESS_KEY>,
$(ConvertTo-SecureString -AsPlainText -String <AWS_SECRET_KEY> -Force)
)
-UseSsl -Port 587
@inducer
inducer / remove-ipynb-output.py
Created February 27, 2014 14:53
Script to remove output in IPython notebook
#! /usr/bin/env python3
from json import load, dump
import sys
if len(sys.argv) != 3:
print("usage: %s INFILE OUTFILE", file=sys.stderr)
with open(sys.argv[1], "rt") as inf:
@lrascao
lrascao / gist:f57312ff33b799c4c0db56b10e80fe26
Created March 31, 2016 16:19
Export/Import datadog dashboards
dash_id=xxxx
api_key=xxx
app_key=xxx
# 1. export
curl -X GET "https://app.datadoghq.com/api/v1/dash/${dash_id}?api_key=${api_key}&application_key=${app_key}" > dash.json
# 2. edit dash.json
move "graphs", "title", "description" up one level in the json hierarchy, from being beneath "dash" to being at the same level