Skip to content

Instantly share code, notes, and snippets.

@deibit
deibit / gist:1576066
Created January 7, 2012 21:15
new auto and for...
// $clang++ --std=c++0x --stdlib=libc++ newfor.cpp -o newfor
#include <vector>
#include <iostream>
using namespace std;
int main()
{
auto v = vector<int>();
@deibit
deibit / hack.sh
Created March 31, 2012 10:33 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@deibit
deibit / hack.sh
Created June 20, 2012 05:52 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
#!/usr/bin/python
# This is a simple port-forward / proxy, written using only the default python
# library. If you want to make a suggestion or fix something you can contact-me
# at voorloop_at_gmail.com
# Distributed over IDC(I Don't Care) license
import socket
import select
import time
import sys
@deibit
deibit / st2.tweaks
Last active December 11, 2015 04:39
My Sublime Text 2 tweaks collection
{
"args":
{
"single_line": false
},
"bold_folder_labels": true,
"caret_style": "phase",
"close_windows_when_empty": false,
"command": "reindent",
"fade_fold_buttons": false,
@deibit
deibit / hashup
Created March 9, 2013 14:57
It reads the (OSX) clipboard and ouput multiple hash of the content. Also if you add a filename as an argument it open the file and hash its content. Windows and Linux port should be straightforward. It paste back the md5 (easy to change) to the clipboard.
#!/usr/bin/env python -B
#
# Clipboard operations from http://www.macdrifter.com/2011/12/python-and-the-mac-clipboard.html
#
# It will paste md5 by default
import sys
import hashlib
import subprocess
@deibit
deibit / URLdecoder.py
Created November 27, 2013 15:59
snippet for decode %20 kind URL characters, accept input from stdin
import sys
import re
for line in sys.stdin.readlines():
r = re.findall("(%\d.)", line)
for i in set(r):
line = line.replace(i, chr(int(i.replace("%",""),16)))
print line
@deibit
deibit / gist:10002286
Created April 6, 2014 06:39
Quick Tab Autocompleter in Python
# Quick tab autocompleter in python
import readline
import rlcompleter
readline.parse_and_bind("tab: completer")
#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select