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
#!/bin/bash | |
cat <<EOF | |
hello | |
there | |
EOF | |
function hered1(){ | |
cat <<EOF | |
hello | |
there |
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
>>> t = timeit.Timer("np.sum(a, axis=0)", | |
... "import numpy as np\na = np.random.randint(1, 1000, (30, 40))" | |
... ) | |
>>> t.repeat(3,100000) | |
[1.3957889080047607, 1.3684840202331543, 1.3558411598205566] | |
>>> t = timeit.Timer("sum(a)", | |
... "import numpy as np\na = np.random.randint(1, 1000, (30, 40))" | |
... ) | |
>>> t.repeat(3,100000) | |
[5.969266176223755, 5.947613954544067, 5.906123876571655] |
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
RANGES="100 1000 10000 100000" | |
for RANGE in $RANGES; do | |
echo "Generating random numbers with a ceiling of $RANGE" | |
while :; do | |
nowtest=$((RANDOM%$RANGE+0)) | |
echo -n $nowtest | |
[[ $nowtest == $lasttest ]] && echo && echo "found side by side collision after $tests tests" && break | |
let tests++ | |
lasttest=$nowtest |
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
import os | |
from setuptools import setup, find_packages | |
here = os.path.abspath(os.path.dirname(__file__)) | |
with open(os.path.join(here, 'README.md')) as f: | |
README = f.read() | |
with open(os.path.join(here, 'CHANGES.md')) as f: | |
CHANGES = f.read() |
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
var dCursor = db.realtime.find( { profileId: "673772" }); | |
var dDocument = dCursor.hasNext() ? dCursor.next() : null; | |
getsize = function(doc) { | |
var dSize = Object.bsonsize(doc); | |
print(dSize) | |
} | |
dCursor.forEach(getsize); |
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
docker run --name=gitlab -d \ | |
-e "GITLAB_HTTPS=true" -e "SSL_SELF_SIGNED=true" \ | |
-e "GITLAB_HTTPS_ONLY=false" -e "HTTPARTY_TIMEOUT=60" \ | |
-v /opt/gitlab/data:/home/git/data sameersbn/gitlab:7.0.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
import random | |
ranges = [ | |
32767, | |
2147483647, | |
9223372036854775807, | |
] | |
for range in ranges: | |
print('generating integers in range 0-%i') % range | |
count = 0 | |
cur_rand = 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
$ python2 ~/bin/random_test.py | |
generating integers in range 0-32767 | |
found sequential random collision after 22893 iterations | |
generating integers in range 0-2147483647 | |
found sequential random collision after 340197 iterations | |
generating integers in range 0-9223372036854775807 | |
found sequential random collision after 132434 iterations | |
$ python2 ~/bin/random_test.py | |
generating integers in range 0-32767 | |
found sequential random collision after 27756 iterations |
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
[server:main] | |
use = egg:gunicorn#main | |
host = 0.0.0.0 | |
port = 6543 | |
workers = 20 | |
worker_class = gevent |
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
version=1.7.1 | |
[general] | |
# What to display in S mode: graph, status, pivoted status | |
S_func=s | |
# Which set of variables to display in S (Variables & Status) mode | |
S_set=general | |
# Whether to auto-wipe InnoDB deadlocks | |
auto_wipe_dl=0 |