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 ( | |
"bytes" | |
"errors" | |
"fmt" | |
"os/exec" | |
"strings" | |
"time" | |
) |
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" | |
"strings" | |
"sync" | |
) | |
type RowMapper interface { | |
Map(src chan []string) chan []string |
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" | |
"strings" | |
"sync" | |
) | |
type RowMapper interface { | |
Map(src chan []string) chan []string |
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
from kombu import Connection | |
import datetime | |
import os | |
with Connection('pyamqp://dallas:marlow@localhost:5672/%s' % os.environ.get('vhost', '/')) as conn: | |
queue = conn.SimpleQueue('test') | |
message = 'hello vine - %s' % datetime.datetime.today() | |
queue.put(message) | |
print('sent msg: %s' % message) | |
queue.close() |
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 ruby | |
today = Time.now.yday | |
duplicate_files = [] | |
File.read('/opt/images.tsv').lines.reduce([]) do |files, entry| | |
size, filename = entry.chomp.split | |
if filename and not filename.empty? | |
files << [File.basename(filename), filename].join(':') | |
end |
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" | |
"math" | |
"sort" | |
"sync" | |
"time" | |
) |
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 texttable | |
import ( | |
"bytes" | |
"errors" | |
"fmt" | |
"strconv" | |
"strings" | |
"text/tabwriter" | |
) |
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
if *loopId == 0 || *loopId > *loopMax-1 { | |
log.Fatalf("invalid loop device number: %d", *loopId) | |
} | |
loopDevNum := int((*loopId & 0xff) | ((7 & 0xfff) << 8)) | |
loopDevPath := "/dev/loop" + strconv.Itoa(int(*loopId)) | |
// ensure requested loop device is unique and read file | |
// permissions from existing loop device | |
devices, err := ioutil.ReadDir("/dev") |
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
bash -c "ls * | xargs -I{} -P4 convert {} +repage {}.gif" | |
gifsicle --loop --resize-fit-width 400 --delay 35 --dither --colors 256 --disposal previous -O2 *.gif > corner.gif |
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
http://thisthread.blogspot.com/2013/06/spoj-prime-generator.html | |
https://gist.github.com/codysoyland/7164035 | |
http://play.golang.org/p/9U22NfrXeq | |
http://www.haskell.org/haskellwiki/Prime_numbers | |
http://en.wikipedia.org/wiki/Generating_primes | |
http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes | |
http://www.primesdemystified.com/ | |
http://www.psp-project.de/llrnetstats.php | |
http://www.psp-project.de/stats.html | |
http://www.henleyclan.co.uk/sobsieve/alltime/scores_t.htm |