Skip to content

Instantly share code, notes, and snippets.

@jwatson
jwatson / keybase.md
Last active September 15, 2016 16:02

Keybase proof

I hereby claim:

  • I am jwatson on github.
  • I am jwatson (https://keybase.io/jwatson) on keybase.
  • I have a public key ASC_nRyd7q5jvcHxI8cvGgW-ACFLQufJNwdvrAK2NEA8CQo

To claim this, I am signing this object:

@jwatson
jwatson / hipchat.m
Last active August 29, 2015 13:57
A simple function for sending messages to a HipChat room.
static void SendHipChatMessage(NSString *token, NSString *room, NSString *message)
{
NSDictionary *params = @{
@"auth_token": token,
@"format": @"json",
@"room_id": room,
@"from": @"Mapkin App",
@"message": message,
@"message_format": @"text",
@"notify": @1,
@jwatson
jwatson / ndev_error.html
Created July 31, 2013 23:32
NDev 401 Error
html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 401 x-nuance-sessionid26a77594-335c-4340-bc83-2e898cc1660b
Received QueryError: Application ID or application key either invalid or expired.</title>
</head>
<body><h2>HTTP ERROR 401</h2>
<p>Problem accessing /NMDPTTSCmdServlet/tts. Reason:
<pre> x-nuance-sessionid26a77594-335c-4340-bc83-2e898cc1660b
Received QueryError: Application ID or application key either invalid or expired.</pre></p><hr /><i><small>Powered by Jetty://</small></i><br/>
@jwatson
jwatson / ndev_error.html
Created July 31, 2013 23:32
NDev 401 Error
html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 401 x-nuance-sessionid26a77594-335c-4340-bc83-2e898cc1660b
Received QueryError: Application ID or application key either invalid or expired.</title>
</head>
<body><h2>HTTP ERROR 401</h2>
<p>Problem accessing /NMDPTTSCmdServlet/tts. Reason:
<pre> x-nuance-sessionid26a77594-335c-4340-bc83-2e898cc1660b
Received QueryError: Application ID or application key either invalid or expired.</pre></p><hr /><i><small>Powered by Jetty://</small></i><br/>
@jwatson
jwatson / ndev_tts.py
Created July 31, 2013 21:39
Sample NDev TTS application.
#!/usr/bin/env python
#vim: set fileencoding=utf8
"""
This example depends on the `requests` library
http://requests.readthedocs.org/en/latest/
$ pip install requests
@jwatson
jwatson / gist:5307444
Created April 4, 2013 03:23
Hockey + Nginx.
user www-data;
worker_processes 1;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
use epoll;
accept_mutex off;
}
@jwatson
jwatson / run_pgbadger.py
Created January 14, 2013 17:43
Automate capturing PgBadger analysis.
from __future__ import print_function
import time
from fabric.api import get, local, run, sudo
def run_pg_badger():
db_name = "mapkin"
sudo("perl -pi -e 's/log_min_duration_statement = .*/log_min_duration_statement = 0/' /etc/postgresql/9.*/main/postgresql.conf")
@jwatson
jwatson / pg_tuner.py
Created January 13, 2013 20:41
Tune some system-specific PostgreSQL parameters.
#!/usr/bin/env python
# vim: set fileencoding=utf-8
from __future__ import print_function
from fabric.api import env, run, sudo
from fabric.colors import cyan, green, yellow
from fabric.state import output
@jwatson
jwatson / mapquest.py
Created October 17, 2012 19:43
MapQuest Directions API Example
#!/usr/bin/env python
from __future__ import print_function
import json
import os
import requests
import sys