LC_ALL=ISO-8859-1 awk 'BEGIN{ \
pi=atan2(0,-1); r=128; \
for (j=0; j<360; j+=10) { \
lx=cos(pi/180*j); ly=sin(pi/180*j); lz=2; lm=sqrt(lx*lx+ly*ly+lz*lz); \
print "P6"; print r*2,r*2; print "255"; \
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
from random import random | |
print 4 * reduce(lambda a, (c, d): (a * (d - 1) + c) / d, ((1.0 if random()**2 + random()**2 <= 1 else 0, i) for i in range(1, 10**6)), 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
from random import random | |
l = lambda (a, b), c: (a + c, b + 1) | |
g = (1 if random()**2 + random()**2 <= 1 else 0 for i in range(10**6)) | |
r, t = reduce(l, g, (0.0, 0)) | |
print r / t * 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
{"1xx":"**Informational**", | |
"100":"Continue", | |
"101":"Switching Protocols", | |
"2xx":"**Successful**", | |
"200":"OK", | |
"201":"Created", | |
"202":"Accepted", | |
"203":"Non-Authoritative Information", | |
"204":"No Content", | |
"205":"Reset Content", |
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 | |
import sys | |
from ftplib import FTP | |
# python ftpput.py [server] [dir_on_server] [local_dir] | |
ftp = FTP(sys.argv[1]) | |
ftp.login() | |
ftp.cwd(sys.argv[2]) |
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
"tabs | |
:set tabstop=4 | |
:set shiftwidth=4 | |
:set expandtab | |
"code folding | |
:set foldmethod=indent | |
:set foldlevelstart=99 | |
"command completion | |
:set wildmode=longest,list,full | |
:set wildmenu |
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
diff --git a/gator-driver/gator_backtrace.c b/gator-driver/gator_backtrace.c | |
index 0670d6c..903e964 100644 | |
--- a/gator-driver/gator_backtrace.c | |
+++ b/gator-driver/gator_backtrace.c | |
@@ -130,17 +130,13 @@ static int report_trace(struct stackframe *frame, void *d) | |
} | |
#endif | |
-// Uncomment the following line to enable kernel stack unwinding within gator, note it can also be defined from the Makefile | |
-// #define GATOR_KERNEL_STACK_UNWINDING |
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
map_osm = folium.Map(location=[45.5236, -122.6750], zoom_start=12) | |
map_osm |
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/sh | |
videos=`curl -s "https://api.dailymotion.com/user/$1/videos?limit=100" | jq '.list|.[]|.id'` | |
for id in $videos; | |
do | |
id=${id#\"} | |
id=${id%\"} | |
url=`curl -s "https://api.dailymotion.com/video/$id?fields=url"|jq .url` | |
youtube-dl -f 1080 $url | |
done |
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/sh | |
# tested with BusyBox v1.22.1 | |
if [ "$#" -ne 1 ]; then | |
echo Usage: $0 http://altyazi.org/sub/s/...html | |
exit 1 | |
fi | |
HTML=`curl -s -c cookies.txt $1` |