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 bash | |
declare -i min=0 | |
declare -i max=10 | |
host=$(ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+') | |
for (( c=min; c<max; c++ )) do | |
echo "Going to start worker # $c" | |
docker run\ |
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 sh | |
echo "Building go library:" | |
go build -o libtest.so -buildmode=c-shared ./main.go || exit | |
echo "Building C executible:" | |
clang --verbose -DUSE_SHARED_LLVM=on -L/tmp/so -ltest -I/tmp/so main.c -o main -Wall || exit | |
echo "Done" |
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
// +build windows | |
package main | |
import ( | |
"fmt" | |
"path/filepath" | |
"syscall" | |
"unsafe" | |
) |
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 ( | |
"io" | |
"io/ioutil" | |
"github.com/moutend/go-wav" | |
) | |
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
#!/usr/bin/env python2 | |
def validate_id_number(id_num): | |
anID = id_num.zfill(9) | |
return sum( | |
sum( | |
map( | |
int, str(int(a)*(i % 2 + 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
<?php | |
$doc = new DOMDocument(); | |
$doc->loadHTMLFile('test.html', LIBXML_NOWARNING | LIBXML_NOERROR); | |
$nodes = $doc->getElementsByTagName('head'); | |
if ($nodes->length <= 0) { | |
die('no head found'); | |
} |
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" | |
"net" | |
"os" | |
"strings" | |
) | |
// GetMachineInfo return a list of: |
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" | |
"time" | |
) | |
func main() { | |
t, _ := time.Parse("2006-01-02 15:04", "2021-05-17 10:55") | |
today := t.Weekday() |
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
require 'thread' | |
queue = Queue.new | |
threads = [] | |
1.step(1000) do |i| | |
queue << i | |
end | |
8.times do |