This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"golang.org/x/text/language" | |
"golang.org/x/text/language/display" | |
) | |
var userPrefs = language.Make("en-CA") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
now = !DATE="$(date +"%s %z")" GIT_COMMITTER_DATE="$DATE" git commit --amend --date "$DATE" -C HEAD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"sync" | |
"time" | |
) | |
func main() { | |
var wg sync.WaitGroup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
touch "db/migrate/$(date +%m%d%Y%H%M%S)_create_user.rb" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\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}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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); |
NewerOlder