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
[].forEach.call(document.querySelectorAll('form'), function (input) { | |
var table = []; | |
console.group('HTMLForm "' + input.name + '": ' + input.action); | |
console.log('Element: ', input, '\nName: ' + | |
input.name + '\nMethod: ' + input.method.toUpperCase() + | |
'\nAction: ' + input.action || 'null'); | |
['input', 'textarea', 'select'].forEach(function (control) { | |
[].forEach.call(input.querySelectorAll(control), function (node) { | |
table.push({ |
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
# @see http://stackoverflow.com/a/2182437 | |
class Enum(set): | |
def __getattr__(self, name): | |
if name in self: | |
return name | |
raise AttributeError |
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
#!/usr/bin/env python | |
#http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/ | |
import sys, os, time, atexit | |
from signal import SIGTERM | |
class Daemon: | |
""" | |
A generic daemon class. | |
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 | |
# Runs the specified command (provided by the first argument) in all tmux panes | |
# for every window regardless if applications are running in the terminal or not. | |
function execute_in_all_panes { | |
# Notate which window/pane we were originally at | |
ORIG_WINDOW_INDEX=`tmux display-message -p '#I'` | |
ORIG_PANE_INDEX=`tmux display-message -p '#P'` |
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 timestampify = (function() { | |
'use strict'; | |
var SECOND = 1000; | |
var MINUTE = 60 * SECOND; | |
var HOUR = 60 * MINUTE; | |
var DAY = 24 * HOUR; | |
var MONTH = 30 * DAY; | |
var YEAR = 365 * DAY; |
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
#Newbie programmer | |
def factorial(x): | |
if x == 0: | |
return 1 | |
else: | |
return x * factorial(x - 1) | |
print factorial(6) | |
#First year programmer, studied Pascal |
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
#!/usr/bin/env python2 | |
""" | |
Author: takeshix <takeshix@adversec.com> | |
PoC code for CVE-2014-0160. Original PoC by Jared Stafford (jspenguin@jspenguin.org). | |
Supportes all versions of TLS and has STARTTLS support for SMTP,POP3,IMAP,FTP and XMPP. | |
""" | |
import sys,struct,socket | |
from argparse import ArgumentParser |
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 -e | |
# | |
# Author: Werner Beroux <werner@beroux.com> | |
# Help? | |
if [[ $# -eq 0 || $1 == --help || $1 == -h ]] | |
then | |
echo "inotifyexec version 1.1.0" | |
echo "Requires inotify-tools." | |
echo "" |
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
[user] | |
name = Ton Nom | |
email = ton@email.tld | |
[color] | |
ui = auto | |
[alias] | |
st = status | |
ci = commit | |
lg = log --graph --pretty=tformat:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%an %ar)%Creset' | |
[core] |
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
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
// MIT license | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; |
OlderNewer