Skip to content

Instantly share code, notes, and snippets.

View pkrefta's full-sized avatar
😃

Paweł Krefta pkrefta

😃
View GitHub Profile
@pkrefta
pkrefta / gist:2378614
Created April 13, 2012 17:32 — forked from searls/gist:1033143
JavaScript example of Gruber's URL matching regex http://daringfireball.net/2010/07/improved_regex_for_matching_urls
//Gruber wrote this regex for matching URLs, but it took a small amount of massage to use it in JavaScript. So here.
//Sauce: http://daringfireball.net/2010/07/improved_regex_for_matching_urls
var p = /\b((?:https?:\/\/|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i;
p.exec('party fun www.twitter.com yay') //winning.
@pkrefta
pkrefta / hack.sh
Created April 1, 2012 21:11 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#