Skip to content

Instantly share code, notes, and snippets.

View dryliketoast's full-sized avatar

Michael Kane dryliketoast

View GitHub Profile
@dryliketoast
dryliketoast / gist:98ed9dc4522374ce8491
Created July 22, 2014 07:56
iptables time based rules
iptables -t mangle -A timedredirection -m time --timestart 06:00:00 --timestop 21:00:00 -j RETURN
@dryliketoast
dryliketoast / regex-url
Created November 10, 2011 15:45
regex for URL matching
From rfc3986:
As the "first-match-wins" algorithm is identical to the "greedy"
disambiguation method used by POSIX regular expressions, it is
natural and commonplace to use a regular expression for parsing the
potential five components of a URI reference.
The following line is the regular expression for breaking-down a
well-formed URI reference into its components.
@dryliketoast
dryliketoast / html5-data-attr
Last active December 18, 2016 21:54
html5 howto: pass args from markup to jquery using "data-" attribute
HTML5:
<a class="clicker" data-mynumber="311">Click</a>
JQUERY:
$('.clicker').attr('data-mynumber');
// returns 311
$('.clicker').data('mynumber');
// returns 311