Skip to content

Instantly share code, notes, and snippets.

@partkyle
partkyle / logpp
Last active August 29, 2015 13:56
JSON logpp in python
#!/usr/bin/env python
import datetime
import fileinput
import json
import logging
import sys
import time
@partkyle
partkyle / Solarized (Light).tmTheme
Created December 22, 2013 22:33
Solarized Light theme for sublime and textmate that has a visible highlight
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Solarized (light)</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>

This is an example command for Backtick. A Backtick command consists of some executable JavaScript and a bit of metadata in JSON.

Here are the required steps to create a command:

  1. Create a new Gist with a command.js and command.json file, or simply fork this one.

  2. Write your JavaScript in command.js. This will be injected into and executed on the page the user is currently on when they run it.

  3. Add some metadata to the command.json file:

  • name: The name of the command.
@partkyle
partkyle / xml_json.md
Last active December 22, 2015 08:08
XML & JSON

Problems with both XML and JSON as api responses

Say we have a simple api endpoint:

GET /profile
Accept: application/json

Local (OS X) Side

~/Library/LaunchAgents/pbcopy.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
     <key>Label</key>
     <string>localhost.pbcopy</string>
@partkyle
partkyle / install-emacs.sh
Last active December 20, 2015 12:49
install emacs locally from source
LOCAL=$HOME/local
VERSION=24.3
mkdir -p $HOME/build
cd $HOME/build
wget http://ftp.gnu.org/gnu/emacs/emacs-$VERSION.tar.gz
tar xvfz emacs-$VERSION.tar.gz
cd emacs-$VERSION
@partkyle
partkyle / install-emacs.sh
Created August 1, 2013 18:30
install emacs locally from source
LOCAL=$HOME/local
VERSON=24.3
mkdir -p $HOME/build
cd $HOME/build
wget http://ftp.gnu.org/gnu/emacs/emacs-$VERSION.tar.gz
tar xvfz emacs-$VERSION.tar.gz
cd emacs-$VERSION
@partkyle
partkyle / install-vim.sh
Last active December 20, 2015 11:48
install vim from source to $HOME
# requires mercurial
set -e
LOCAL=$HOME/local
BUILD=$HOME/build
if [ -z "$VERSION" ]; then
VERSION="v7-4-005"
fi
@partkyle
partkyle / install-tmux-1.8.sh
Created July 31, 2013 19:29
install tmux from source in home directory
#!/bin/bash
# exit on error
set -e
# create our directories
mkdir -p $HOME/local $HOME/tmux_tmp
cd $HOME/tmux_tmp
# download source files for tmux, libevent, and ncurses
@partkyle
partkyle / install-git
Last active December 19, 2015 00:39 — forked from jcf/Download and install git from source
install git from source into $HOME
set -e
LOCAL=$HOME/local
mkdir -p $HOME/build
cd $HOME/build
VERSION='1.8.3.1'
wget http://www.kernel.org/pub/software/scm/git/git-$VERSION.tar.gz
tar xzvf git-$VERSION.tar.gz