Skip to content

Instantly share code, notes, and snippets.

View smialy's full-sized avatar

Piotr Smialkowski smialy

View GitHub Profile
@smialy
smialy / rekman.py
Last active February 5, 2020 08:28
import json
import hmac
import hashlib
import urllib.parse
from datetime import datetime
import requests
def get_nonce():
@smialy
smialy / pyparse_sql.py
Created March 4, 2017 08:53
sql parse using pyparsing
from pyparsing import *
def to_int(item):
return int(item[0])
selectToken = CaselessLiteral( "SELECT" )
fromToken = CaselessLiteral( "FROM" )
sub_select = Forward()
@smialy
smialy / .netrc
Created September 17, 2015 08:08
machine 10.140.18.98
login smialkowskipext
password <passsord>
git submodule foreach sh -c 'git remote remove gerrit; exit 0'
for files in *;
do
convert -resize 100^ -gravity center -crop 100x100+0+0 "$files" "small/$files" ;
done;
@smialy
smialy / gist:4676782
Created January 30, 2013 20:46
toInt
function toInt(x) {
x = Number(x);
return x < 0 ? Math.ceil(x) : Math.floor(x);
}
@smialy
smialy / gist:4676767
Last active October 29, 2021 05:03
base64 ecoder
var base64 = {
encode:function( str ) {
return window.btoa(unescape(encodeURIComponent(str)));
},
decode:function( str ) {
return decodeURIComponent(escape(window.atob(str)));
}
};