Skip to content

Instantly share code, notes, and snippets.

@jamesgecko
jamesgecko / init.lua
Created November 1, 2016 18:16 — forked from rjhilgefort/init.lua
Hammerspoon config to send escape on short ctrl press
local sendEscape = true
local ctrlKeyTimer = hs.timer.delayed.new(0.15, function()
sendEscape = false
end)
local lastMods = {}
local flagsChangedHandler = function(event)
local newMods = event:getFlags()
if lastMods.ctrl == newMods.ctrl then return false end

Keybase proof

I hereby claim:

  • I am jamesgecko on github.
  • I am jamesgecko (https://keybase.io/jamesgecko) on keybase.
  • I have a public key ASD4BgjKFTTy4-vz9nmAuD9YjuA9ej80xVJ71J6mM_B3Gwo

To claim this, I am signing this object:

@jamesgecko
jamesgecko / tileset-p8.py
Created September 9, 2015 21:06
Quick Pico-8 image encoder
from PIL import Image
PALETTE = ((0,0,0), (29, 43, 83), (128, 37, 83), (0, 135, 81),
(171,82,54), (95,87,79), (194,195,199), (255,241,232),
(255,0,77), (255,163,0), (255,255,39), (0,231,86),
(41,173,255), (131,118,156), (255,119,168), (255,204,170))
def main():
im = Image.open('tilesetP8.png')
px = im.load()

Learn to Program

I want awesome general purpose development tools

  • Atom is the best easy-to-learn free text editor right now.
  • Git is a great versioning tool with a somewhat confusing interface.
  • ConEmu is a nice Windows command line replacement when you eventually get sick of the default one.

I want to learn practical Python stuff

@jamesgecko
jamesgecko / devurl
Created November 4, 2014 20:36
Get my current development url on OS X
#!/bin/sh
interface=$(route get 0.0.0.0 2>/dev/null | awk '/interface: / {print $2}')
domain="http://$(ipconfig getifaddr $interface):3000"
echo $domain
@jamesgecko
jamesgecko / change-status-from-wifi.applescript
Created September 18, 2014 18:03
Use this script with Adium to set your status message based on what wifi network you're connected to. In Adium's Preferences, on the Events tag, edit or add the "You connect" event and add "Run the AppleScript 'change-status-from-wifi'"
set mySSID to do shell script "/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | awk '/ SSID/ {print substr($0, index($0, $2))}'"
if mySSID is "HomeNetwork" then
set message to "Working from home"
end if
if mySSID is "WorkNetwork" then
set message to "Working from the office"
end if
tell application "System Events"
if exists process "Adium" then tell application "Adium" to set status message of every account to message
end tell
@jamesgecko
jamesgecko / cmd-hijack.js
Created July 28, 2014 20:13
Stop Cmd shortcut hijacking in Firefox
// ==UserScript==
// @name Disable interceptions of Cmd+t, Cmd+w, Cmd+shift+] and Cmd+shift+[
// @namespace http://userscripts.org/users/642403
// @description Stop websites from hijacking keyboard shortcuts
//
// @run-at document-start
// @include *
// @grant none
// ==/UserScript==
<link rel="import" href="../paper-button/paper-button.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
#!/bin/bash
unzip ./RTL8192xC_USB_linux_v3.4.4_4749.20121105.zip
cd ./RTL8188C_8192C_USB_linux_v3.4.4_4749.20121105/driver/
tar -xvf ./rtl8188C_8192C_usb_linux_v3.4.4_4749.20121105.tar.gz
cd ./rtl8188C_8192C_usb_linux_v3.4.4_4749.20121105/
patch -p1 < ../../../rtl8188C_8192C_usb_linux_v3.4.4_4749.20121105_patch.txt
make
make install
insmod ./8192cu.ko