Skip to content

Instantly share code, notes, and snippets.

View kaeawc's full-sized avatar
🤓
Probably coding

Jason Pearson kaeawc

🤓
Probably coding
View GitHub Profile
@kaeawc
kaeawc / .zshrc
Created November 30, 2014 22:40
zsh profile
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="muse"
# Uncomment the following line to use case-sensitive completion.
@kaeawc
kaeawc / test_pip_requirements.py
Last active August 29, 2015 14:10
Test case that compares pip freeze output to the project's requirements.txt file
import unittest
import subprocess
from StringIO import StringIO
class ProjectRequirementsSpec(unittest.TestCase):
def parse_requirement(self, requirement):
requirement = requirement.replace('\n', '')
mandrill.messages.send_template(template_name='welcome-new-user', template_content=[], message={'to':[{'email': '[email protected]'}]}, send_at=future_time)
# [{u'_id': u'ae905120f7194c1fb6d9e529db3fc353',
# u'email': u'[email protected]',
# u'reject_reason': None,
# u'status': u'scheduled'}]
mandrill.messages.list_scheduled(to='[email protected]')
# [{u'_id': u'ae905120f7194c1fb6d9e529db3fc353',
@kaeawc
kaeawc / mailchimp_subscribe_example.py
Last active August 29, 2015 14:09
Mailchimp Subscription
apikey = 'you_api_key'
list_id = 'your_list_id'
from mailchimp import Mailchimp
mailchimp = Mailchimp(apikey=apikey)
mailchimp.lists.subscribe(id=list_id, email={u"email",u"[email protected]"})
@kaeawc
kaeawc / decode.sh
Last active February 21, 2025 10:26
Decode base64-encoded gzipped tar file
base64 -D thefile | tar -xz
### Keybase proof
I hereby claim:
* I am kaeawc on github.
* I am kaeawc (https://keybase.io/kaeawc) on keybase.
* I have a public key whose fingerprint is 6E7A 3856 CF66 FF0B 848B 723A 3150 F227 277B B2D8
To claim this, I am signing this object:
@kaeawc
kaeawc / gist:ea40f7efc3b46ace2794
Created September 16, 2014 16:20
Using subqueries and aliases to create aggregations
SELECT COUNT(a.asdf) as count_of_asdfs FROM (SELECT 2 as asdf ) as a JOIN (SELECT 3 as fdsa) as b ON b.fdsa=3 GROUP BY b.fdsa;
@kaeawc
kaeawc / storm-kafka-notes.md
Last active December 21, 2015 18:29
Notes from Storm + Kafka meetup on 08/26/2013

Storm Overview

What are the parts?

A Spout takes some input and decides whether or not that input is worth passing on based on some logic.

Bolts do some intensive operation on a given data, which might be composed together.

creating a spout means just extending BasicSpout

@kaeawc
kaeawc / signed_web_request.sh
Created August 25, 2013 19:38
Starting as a nonuser, I sign up for an account at https://www.somewebservice.com https://www.somewebservice.com gives me public and private keys https://www.somewebservice.com generates completely random strings and stores them for user I keep keys in a secure place (not committed in code)
DATA_TO_SIGN = SOME_DATA + PRIVATE_API_KEY
md5 -s "DATA_TO_SIGN"
curl "https://www.somewebservice.com/api/v1/getAwesomeStuff" --data "API_KEY=YOUR_PUBLIC_API_KEY&signature=CALCULATED_SIGNATURE"
@kaeawc
kaeawc / PlayScalaJsArray.scala
Last active December 18, 2015 22:09
Play! Scala code demonstrating folding left on a model that is using imperative JSON to create a JavaScript array
import java.util.Date
import play.api.libs.json._
case class Event(name:String,when:Date) extends JsSerializable
object Event extends ((String,Date) => Event) {
implicit val r = Json.reads[Event]()
implicit val w = Json.writes[Event]()
}