Skip to content

Instantly share code, notes, and snippets.

@swinton
swinton / stunnel.md
Created November 12, 2014 19:26
Stunnel HOWTO

Basically:

Install stunnel

brew install stunnel

Create /usr/local/etc/stunnel/stunnel.pem

openssl genrsa -out key.pem 2048
@swinton
swinton / receipt.xml
Created November 21, 2014 21:36
A receipt, as seen by Evernote
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<!DOCTYPE recoIndex PUBLIC "SYSTEM"
"http://xml.evernote.com/pub/recoIndex.dtd">
<recoIndex docType="unknown" objType="image"
objID="5f5306f6cda9364ef734165ecaa43d31" engineVersion="6.5.17.7"
recoType="service" lang="en" objWidth="534" objHeight="778">
<item x="173" y="133" w="80" h="22">
<t w="78">Welcome</t>
<t w="46">Wei come</t>
<t w="42">Wei came</t>
@swinton
swinton / notes.md
Last active August 29, 2015 14:13
Notes on using the samples supplied with the Amazon Kinesis Client Library for Python

Host

git clone https://github.com/awslabs/amazon-kinesis-client-python.git
cd amazon-kinesis-client-python/
mkdir vm
cd vm
vagrant init ubuntu/trusty64
# Include in Vagrantfile:
# config.vm.synced_folder "..", "/home/vagrant/existence",
#!/bin/bash
# For more info: https://help.ubuntu.com/community/UbuntuTime#Time_Synchronization_using_NTP
ntpdate ntp.ubuntu.com
CREATE TABLE person (
id INTEGER PRIMARY KEY,
first_name TEXT,
last_name TEXT,
age INTEGER
);
CREATE TABLE pet (
id INTEGER PRIMARY KEY,
owner_id INTEGER,

Advanced Query Search

Use Advanced Query Search (AQS), to refine your search results. In the search box, type a keyword from the table below, followed by a colon and what to search for. For example, to find messages with a subject that contains “report”, enter subject:report in the search box.

#!/usr/bin/env python
"""
Have OS X read tweets aloud to you.
usage:
tweet_speak.py -u <user> [-p <password>] [-f <comma-seperated list of twitter user ids to follow> | -t <comma-seperated list of keywords to track>]
"""
# Inspired by this gist: http://gist.github.com/267147
#!/usr/bin/env python
"""
Have OS X play a song on Spotify via a Twitter request
This work is licensed under the Creative Commons Attribution-Noncommercial 2.0 UK: England & Wales License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/2.0/uk/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
See: http://www.nixonmcinnes.co.uk/2010/01/07/crowd-sourcing-the-office-stereo-using-twitter-and-spotify/
usage:
#!/usr/bin/env python
import httplib, re, sys
from urllib import urlencode
def get_spotl_url(uri):
"""
Returns a spo.tl URL, given a Spotify track URI
"""
#
#!/bin/bash
#
# Add attachments to Mail.app from the command line
#
open -a Mail.app $@