Skip to content

Instantly share code, notes, and snippets.

View cchana's full-sized avatar

Charanjit Chana cchana

View GitHub Profile
flex-flow:column-reverse wrap-reverse;
justify-content:center;
align-content:space-between;
@k9ordon
k9ordon / gpxImport.php
Created July 16, 2012 08:35
exports nike+ runs to gpx
<pre>
strt importing gpx files ...
<?php
require_once 'lib/init.php'; // init $n stuff (login)
$dir = "import";
$runs = $n->activities();
foreach($runs->activities as $a) {
@siffring
siffring / .htaccess
Created March 4, 2012 17:33
htaccess to password protect a specific server
# ----------------------------------------------------------------------
# Password protect staging server
# Use one .htaccess file across multiple environments
# (e.g. local, dev, staging, production)
# but only password protect a specific environment.
# ----------------------------------------------------------------------
SetEnvIf Host staging.domain.com passreq
AuthType Basic
AuthName "Password Required"
//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.