Skip to content

Instantly share code, notes, and snippets.

View SergioLaRosa's full-sized avatar

Sergio La Rosa SergioLaRosa

View GitHub Profile
@SergioLaRosa
SergioLaRosa / newTimer.js
Created April 19, 2019 15:39
A better setTimeout
//credits to: https://ilinkuo.wordpress.com/2014/01/05/a-better-settimeout/
function setTimeout3(callback, delay){
var handle = new Number(setTimeout(callback, delay));
handle.clear = function(){clearTimeout(handle);};
return handle;
}
@SergioLaRosa
SergioLaRosa / ubuntu_workstation_setup.sh
Created April 20, 2018 17:20
Minimal dev enviroment setup script (Ubuntu-based distro only)
#Written by Sergio La Rosa ([email protected])
#https://gist.github.com/SergioLaRosa/
printf "#######################################"
printf "\n### UBUNTU WORKSTATION SETUP SCRIPT ###"
printf "\n#######################################\n"
printf "\n[+] The script downloads and install the following packages:\n"
printf "* pip3\n"
printf "* python3 setup/packaging tools (dist, twine)\n"
printf "* nano\n"
@SergioLaRosa
SergioLaRosa / web-servers.md
Created April 20, 2018 11:07 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@SergioLaRosa
SergioLaRosa / get_md5.py
Created March 28, 2018 12:01
Simple script to get md5 hash from files
#Written by Sergio La Rosa ([email protected])
#https://gist.github.com/SergioLaRosa/
#IMPORTANT: Python 3 only
import hashlib
#Change this parameters
filename = "example.bin"
read_bytes = 1024
@SergioLaRosa
SergioLaRosa / dict_to_csv.py
Last active March 28, 2018 11:58
A fast, simple script for writing Python dicts to CSV
#Written by Sergio La Rosa ([email protected])
#https://gist.github.com/SergioLaRosa/
#IMPORTANT: Python 3 only
#Standard dict format
'''
'key':'value'
'''
#Standard CSV format
'''