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
func (r *repo_handle) get_tar_file() (string, error) { | |
target_dir, tmpdir_err := ioutil.TempDir("", "captain_app_tar") | |
log.Println("Got temp directory for app tar", target_dir) | |
if tmpdir_err != nil { | |
return "", tmpdir_err | |
} | |
archive_path := target_dir + "/" + "app.tar" | |
log.Println("Going to create the tar archive at path", archive_path) |
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
[sc-chi] root@proxy-02:~# docker insert slsdhf app.tar /tmp/app.tar | |
[sc-chi] root@proxy-02:~# echo $? | |
0 |
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
require 'minitest/autorun' | |
class TestWords < Minitest::Test | |
def test_that_similar_words_are_found | |
assert_equal one_off_words("moor", ["door", "moot", "boot", "boots"]), ["door", "moot"] | |
end | |
def test_fake_failure | |
assert_equal one_off_words("moor", ["door", "moot", "boot", "boots"]), ["door", "moot", "fuckers"] | |
end |
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
class Array | |
def xor(key) | |
a = dup | |
a.length.times { |n| a[n] ^= key[n % key.size] } | |
a | |
end | |
end | |
stra = "123abc" | |
strb = "123adc" |
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 ( | |
"github.com/wjessop/go-piglow" | |
"log" | |
) | |
func main() { | |
var p *piglow.Piglow | |
var err error |
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
require 'thread' | |
LAST_VAL = 8 | |
q = Queue.new | |
(0..LAST_VAL).to_a.shuffle.each {|i| q << i} | |
vals = [] | |
next_val = 0 | |
loop do | |
puts "popping the stack" |
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
# The API I thought up, This example will | |
# sleep for 16 seconds (4 * 4 seconds + 5 seconds) | |
begin | |
RollingTimeout.new(5) {|timer| | |
sleep(4) | |
timer.reset | |
sleep(4) | |
timer.reset | |
sleep(4) |
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 backup_downloader | |
import ( | |
"bytes" | |
"io" | |
"log" | |
"os" | |
"os/exec" | |
"sync" | |
) |
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
[1.9.3] ~ $ cd Desktop/Funny\ pictures/ | |
[1.9.3] ~/Desktop/Funny pictures $ sendcat * | |
https://sendc.at/dl/3kqUAI5QGty5uCzqHVbIiCJGZDoULqrSsINOJTAgIEfJBnEHsr62Pel | |
105.gif was already uploaded, skipping | |
1265713754_fl: 100% |========================| 469.1KB 108.8KB/s ETA: 00:00:00 | |
1324316240_ca: 100% |========================| 3.4MB 121.8KB/s ETA: 00:00:00 | |
1RyYE.gif was already uploaded, skipping | |
1rSzCqgzWn8kh: 100% |========================| 1.9MB 117.7KB/s ETA: 00:00:00 | |
1vlzxNk.jpeg: 100% |========================| 226.0KB 101.5KB/s ETA: 00:00:00 | |
292920_10150689018263944_156425228943_9541657_455613102_n.jpg was already uploaded, skipping |
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
magic| tuple | atom | bert | | dict | list 1 elem | list | atom | key | atom | | val | nil | nil | |
131, 104, 3, 100, 0, 4, 98, 101, 114, 116, 100, 0, 4, 100, 105, 99, 116, 108, 0, 0, 0, 1, 108, 0, 0, 0, 2, 100, 0, 3, 107, 101, 121, 100, 0, 3, 118, 97, 108, 106, 106 |