Skip to content

Instantly share code, notes, and snippets.

package main
import (
"fmt"
"golang.org/x/text/language"
"golang.org/x/text/language/display"
)
var userPrefs = language.Make("en-CA")
[alias]
now = !DATE="$(date +"%s %z")" GIT_COMMITTER_DATE="$DATE" git commit --amend --date "$DATE" -C HEAD
script = """
local callcount = tonumber(ARGV[1]) or 0
local maxcps = tonumber(ARGV[2]) or 0
local expected = (tonumber(redis.call('GET', KEYS[1])) or 0) + callcount
if expected > maxcps then
return nil
else
redis.call('incrby', KEYS[1], callcount)
redis.call('expire', KEYS[1], 10)
CREATE OR REPLACE FUNCTION notify_changes() RETURNS trigger AS $notify_changes$
DECLARE
CHANNEL TEXT;
ID TEXT;
JSON TEXT;
BEGIN
CHANNEL := 'changes';
IF (TG_OP = 'DELETE') THEN
ID := OLD.id;
ELSE
package main
import (
"fmt"
"sync"
"time"
)
func main() {
var wg sync.WaitGroup
touch "db/migrate/$(date +%m%d%Y%H%M%S)_create_user.rb"
@jney
jney / cv.tex
Created October 22, 2012 22:17
\documentclass[11pt]{article}
\usepackage[margin=2.5cm]{geometry}
\usepackage[utf8x]{inputenc}
\usepackage{hyperref}
\usepackage{enumitem}
\setdescription{labelsep=\textwidth}
\usepackage{array, xcolor}
\definecolor{lightgray}{gray}{0.8}
\newcolumntype{L}{>{\raggedleft}p{0.14\textwidth}}
\newcolumntype{R}{p{0.8\textwidth}}
#!/usr/bin/perl
my $device_id = $ARGV[0];
`xinput list-props ${device_id}` =~ /Synaptics Off \((\d+)\).*(\d)/;
my $param_id = $1;
my $param_status = abs($2 - 1);
system("xinput", "set-prop", $device_id, $param_id, $param_status);