This file contains hidden or 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
$ run-exclusive.sh ./testlock t.lock |
This file contains hidden or 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
#!/bin/zsh | |
# call like: | |
# $ run-exclusive.sh /path/of/progname /path/of/lockfile | |
# e.g. | |
# $ run-exclusive.sh ./testlock t.lock | |
# clearly you want progname to be something that will only match once. | |
# don't use a short string that is a substring match of something else running | |
export PROGNAME=$1 |
This file contains hidden or 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 ( | |
"os" | |
"fmt" | |
"time" | |
"github.com/bradclawsie/golock" | |
) | |
func main() { |
This file contains hidden or 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
#lang typed/racket | |
(define-type T (U String Integer)) | |
(: fizzbuzz : ((Listof Integer) -> (Listof T))) | |
(define fizzbuzz | |
(lambda (l) | |
(cond [(null? l) '()] | |
[else (let* ([x (car l)] | |
[xs (cdr l)] | |
[mod3 (eq? 0 (modulo x 3))] |
This file contains hidden or 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
module Main where | |
import qualified Data.Conduit as C | |
import qualified Network.HTTP.Conduit as HC | |
main :: IO () | |
main = do | |
manager <- HC.newManager HC.def | |
request' <- HC.parseUrl "https://www.google.com/" | |
let request = request' { HC.checkStatus = \_ _ -> Nothing } | |
response <- C.runResourceT $ HC.httpLbs request manager |
This file contains hidden or 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
extern mod std; | |
fn main() { | |
let mut i = 1; | |
while i <= 100 { | |
let mod3 = ((i % 3) == 0); | |
let mod5 = ((i % 5) == 0); | |
if ! (mod3 || mod5) { | |
io::println(fmt!("%d",i)); | |
} else { |
This file contains hidden or 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" | |
"encoding/json" | |
) | |
type T struct { | |
I int | |
E interface{} |
This file contains hidden or 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
set-option -g status-bg black | |
set-option -g status-fg white | |
set-option -g status-interval 60 | |
set-option -g status-left "#(/home/brad/bin/imapbiff.pl)" | |
set-option -g status-right "#(/home/brad/bin/temp.pl)" | |
set-option -g pane-active-border-fg blue | |
unbind % | |
bind | split-window -h | |
bind - split-window -v | |
bind-key k select-pane -U |
This file contains hidden or 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/env perl | |
use DateTime; | |
$| = 1; | |
my $tmux_out = ''; | |
my $sensors_bin = '/usr/bin/sensors'; | |
if (-e -x $sensors_bin) { | |
my $sensors_out = `$sensors_bin`; | |
if ($sensors_out =~ /temp1\:\s+\+(\d+)/s) { | |
$tmux_out .= '|' . $1 . 'C| '; | |
} |