Skip to content

Instantly share code, notes, and snippets.

View jamtur01's full-sized avatar
I may be slow to respond.

James Turnbull jamtur01

I may be slow to respond.
View GitHub Profile
mturilin /
Created January 26, 2020 07:44
Converst TextExpander csv to espanso yaml
import yaml
import sys
import csv
# create root yaml
matches = []
# open file
technoweenie /
Created May 30, 2010 18:34
GitHub OAuth Busy Developer's Guide

GitHub OAuth Busy Developer's Guide

This is a quick guide to OAuth2 support in GitHub for developers. This is still experimental and could change at any moment. This Gist will serve as a living document until it becomes finalized at

OAuth2 is a protocol that lets external apps request authorization to private details in your GitHub account without getting your password. All developers need to register their application before getting started.

Web Application Flow

  • Redirect to this link to request GitHub access:
require 'rubygems'
require 'mechanize'
EMAIL = ''
SCHEDULE_RANGE = { :start_time => '19:00', :end_time => '20:30' }
ahgittin / jsonball.rb
Created February 23, 2012 21:57
a jekyll tag to parse json files and objects for use as maps subsequently
require 'json'
# JSON parser tag, creating map for use in jekyll markdown
# Alex.Heneveld @ Cloudsoft Corp (remove spaces and add the .com)
# Released under APL 2.0
# usage: {% jsonball varname from TYPE PARAM %}
# where TYPE is one of {data,var,file,page}, described below
karmi /
Created April 8, 2011 17:15
Field notes gathered during installing and configuring ElasticSearch for Website Search: Field Notes

These are field notes gathered during installation of website search facility for the ElasticSearch website.

You may re-use it to put a similar system in place.

The following assumes:

armon /
Created February 21, 2015 01:10
Reap Graphite nodes using Consul members
# Store the live members
consul members | grep alive | awk '{ print $1 }' > /tmp/alive.txt
# Clean-up the collectd metrics
cd /data/graphite/whisper/collectd
ls | awk '{print substr($1, 0, index($1, "_node_")) }' > /tmp/monitored.txt
for NODE in `cat /tmp/monitored.txt`; do if grep -q $NODE /tmp/alive.txt; then echo $NODE alive; else echo $NODE dead; sudo rm -Rf ${NODE}_node_*; fi; done
IngmarStein / ECSDynamicHostPort.go
Last active January 21, 2020 14:32
Get dynamically mapped host port from within ECS container
package main
import (
chethanbandi /
Created June 21, 2016 05:40
AWS ecs deployment
eval $(aws ecr get-login)
docker build -t $TAG .
if[ $? -ne 0 ];then
echo "Docker build failed exiting"
shtirlic / gist:2159621
Created March 22, 2012 16:53
Sinatra base url helper
def base_url
@base_url ||= "#{request.env['rack.url_scheme']}://#{request.env['HTTP_HOST']}"
barn / gist:1511082
Created December 22, 2011 17:23 — forked from jorilallo/gist:1509950
Grove's weechat config
# Add new server for organization YYYYYY
/server add grove
/set irc.server.YYYYYY.password "YYYYYY"
# Set your username to BBBB
/set irc.server.YYYYYY.username "BBBB"
/set irc.server.YYYYYY.nicks "BBBB"
# Set your password
/set irc.server.YYYYYY.command "/msg NickServ identify xxxxxx"