Skip to content

Instantly share code, notes, and snippets.

View misterwell's full-sized avatar

Mike Maxwell misterwell

View GitHub Profile
@misterwell
misterwell / get-aws-creds.sh
Created February 13, 2020 16:12 — forked from Yloganathan/get-aws-creds.sh
Extended https://github.com/sweharris/aws-cli-mfa/blob/master/get-aws-creds and pushed the token, access key and Id to credentials
#!/bin/bash
# This uses MFA devices to get temporary (eg 12 hour) credentials. Requires
# a TTY for user input.
#
# GPL 2 or higher
if [ ! -t 0 ]
then
echo Must be on a tty >&2
@interface NSObject (Debounce)
- (void)debounce:(SEL)action delay:(NSTimeInterval)delay;
- (void)debounce:(SEL)action object:(id)obj delay:(NSTimeInterval)delay;
@end
var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
var fs = require('fs');
var request = require('request');
var showUrl = 'http://api.trakt.tv/show/summary.json/e5d5ed575b955ade53c9fa57d218dd05/suits';
var showJson = {};
var xhr = new XMLHttpRequest();
xhr.open("GET", showUrl, true);
xhr.onload = function (e) {
if (xhr.readyState === 4) {
@misterwell
misterwell / build_tesseract.sh
Created August 18, 2014 05:51
Build tesseract v3 libraries for all iOS architectures
#!/bin/sh
# build.sh
GLOBAL_OUTDIR="`pwd`/dependencies"
LOCAL_OUTDIR="./outdir"
LEPTON_LIB="`pwd`/leptonica-1.71"
TESSERACT_LIB="`pwd`/tesseract-ocr"
IOS_BASE_SDK="7.1"
IOS_DEPLOY_TGT="7.1"
@misterwell
misterwell / CreateP12PushCert.sh
Last active March 3, 2024 18:42
A shell script for creating a .p12 certificate file containing the Certificate & private key for use by an APNS push provider application
#!/bin/sh
# Script for generating .p12 files from APNS .cer files.
# Instructions:
# 1. Generate & download the push certificate inside Apple's developer portal
# 2. Import the .cer file into your Mac's Keychain Access, find it in your certificate list, and expand it to show the paired private key.
# 3. Select both the certificate and the paired private key, CTRL-Click & select Export Keys. Save it as Certificates.p12 in the same folder as the downloaded .cer file. You may give it a passphrase if you'd like, but be sure to remember it if you do.
# 4. Execute this shell file, with the format './CreateP12PushCert.sh <DownloadedCerFilename> <ExportedP12Filename> <OutputP12Filename>'
usage ()
{
@misterwell
misterwell / gmailChatConvos.py
Created July 10, 2014 00:43
Pulling convos with Kate from Gmail
#!/usr/bin/python
import httplib2
from apiclient.discovery import build
from oauth2client.client import flow_from_clientsecrets
from oauth2client.file import Storage
from oauth2client.tools import run