Skip to content

Instantly share code, notes, and snippets.

View tkw1536's full-sized avatar
:octocat:
{{ .Status }}

Tom Wiesing tkw1536

:octocat:
{{ .Status }}
View GitHub Profile
@skanev
skanev / MATH_JOKE.markdown
Created January 29, 2015 14:08
Best. Math Joke. Ever.

When the Ark eventually lands after the Flood, Noah releases all the animals and makes a proclamation: "Go forth and multiply".

Several months later, Noah is delighted to see that all the creatures are breeding, except a pair of snakes, who remain childless. Noah asks: "What's the problem?" The snakes have a simple request of Noah: "Please cut down some trees and let us live there."

Noah obliges, leaves them alone for a few weeks and then returns. Sure enough, there are lot of baby snakes. Noah asks why it was important to cut down the trees, and the snakes reply: "We're adders, and we need logs to multiply."

@tkw1536
tkw1536 / relativeUrl.js
Last active January 26, 2017 20:03
Resolve a relative URL in client-side JavaScript with jQuery.
/*
Resolves a relative url
@param url Url to resolve
@param base Optional. Base url to use.
@param isDir Optional. If set to true, will return a directory name ending with a slash.
*/
var resolve = function(url, base, isDir){
var resolveWithBase = false;
var baseUrl, oldBase, newBase;