Skip to content

Instantly share code, notes, and snippets.

View xingzw's full-sized avatar

xingzw xingzw

View GitHub Profile

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@xingzw
xingzw / gist:4943042
Created February 13, 2013 08:13
is_valid_url
function is_valid_url(string) {
var regexp_url = /((([a-z]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[a-z0-9.-]+|(?:www.|[-;:&=\+\$,\w]+@)[a-z0- 9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[.\!\/\\w]*))?)/i;
if (regexp_url.test(string)) {
return true;
}
else {
return false;
}
}