Skip to content

Instantly share code, notes, and snippets.

View leeoniya's full-sized avatar
😕
shaving bytes and milliseconds. dependencies: {}

Leon Sorokin leeoniya

😕
shaving bytes and milliseconds. dependencies: {}
View GitHub Profile
@leeoniya
leeoniya / gist:11271144
Created April 24, 2014 22:07
address2 stripper
(?:(SPC|SUITE|STE|APT|UNIT|BLDG|FLOOR|FL|ROOM|RM|DEPT)\b\.?\s*#? ?[0-9A-Z]+|\s+# ?[0-9A-Z-]+)$

Use Linode's DNS Manager API for one-line dynamic DNS

This can be useful for cron, for instance.

Prereqs

  • You are using Linode's DNS Manager to manage a zone for your domain
  • You have already created an A record for the name you want to make dynamic
  • You have an API key for Linode's API
  • curl and jsonpp (jsonpp is not necessary but makes the manual steps easier)
@leeoniya
leeoniya / snowden-ietf93.md
Last active September 8, 2015 04:26 — forked from mnot/snowden-ietf93.md
Transcript of Edward Snowden's comments at IETF93.
@leeoniya
leeoniya / po_box_re.js
Created April 1, 2011 23:17
leon's p.o. box detection regex
// leon's p.o. box detection regex
// for better results, trim and compress whitespace first
var pobox_re = /^box[^a-z]|(p[-. ]?o.?[- ]?|post office )b(.|ox)/i,
arr = [
"po box",
"p.o.b.",
"p.o. box",
"po-box",
"p.o.-box",
@leeoniya
leeoniya / json_csv_ideas.js
Created June 17, 2011 19:32
better-than-json recordset passing
(function() {
// mimicing php's array_combine()
function combine(a, b) {
var i, o = {};
for (i in a)
o[a[i]] = b[i];
return o;
}
@leeoniya
leeoniya / README
Created August 12, 2011 18:13 — forked from joelambert/README
Drop in replacements for setTimeout()/setInterval() that makes use of requestAnimationFrame() where possible for better performance
Drop in replace functions for setTimeout() & setInterval() that
make use of requestAnimationFrame() for performance where available
http://www.joelambert.co.uk
Copyright 2011, Joe Lambert.
Free to use under the MIT license.
http://www.opensource.org/licenses/mit-license.php
@leeoniya
leeoniya / gist:1379478
Created November 19, 2011 22:42
testing markdown

GitHub Flavored Markdown

View the source of this content.

Let's get the whole "linebreak" thing out of the way. The next paragraph contains two phrases separated by a single newline character:

Roses are red Violets are blue

@leeoniya
leeoniya / gist:1379476
Created November 19, 2011 22:42
testing markdown
#markdown!