Skip to content

Instantly share code, notes, and snippets.

View kalleth's full-sized avatar

Tom Russell kalleth

View GitHub Profile
package main
import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"log"
"net/http"
_ "net/http/pprof"
@pixeltrix
pixeltrix / atom.xml.builder
Last active December 31, 2015 08:59
Lightweight template rendering for rake tasks, background jobs, etc. using Tilt template engine.
# Feed URLs need to be explict passed as options because there is no request object
atom_feed(
id: "tag:weblog.rubyonrails.org,2005:/feed/atom",
root_url: "http://weblog.rubyonrails.org/",
url: "http://weblog.rubyonrails.org/feed/atom.xml"
) do |feed|
feed.title("Riding Rails")
feed.updated(@posts.first.updated_at)
@posts.each do |post|
@sedm0784
sedm0784 / CapsLockCtrlEscape.ahk
Last active April 11, 2024 22:38
AutoHotkey script to map Caps Lock to Escape when it's pressed on its own and Ctrl when used in combination with another key, à la Steve Losh. Adapted from one that does something similar with the Ctrl Key on the Vim Tips Wiki (http://vim.wikia.com/wiki/Map_caps_lock_to_escape_in_Windows?oldid=32281). (Plus contribs from @randy909 & @mmikeww.)
g_LastCtrlKeyDownTime := 0
g_AbortSendEsc := false
g_ControlRepeatDetected := false
*CapsLock::
if (g_ControlRepeatDetected)
{
return
}