Skip to content

Instantly share code, notes, and snippets.

View TRex22's full-sized avatar
🎮
Life

Jason Chalom TRex22

🎮
Life
View GitHub Profile
@TRex22
TRex22 / gist:c29df184ba6016ae1e31
Created January 6, 2015 14:23
Code from StackOverflow to pull out url query strings in pure JavaScript
//http://stackoverflow.com/questions/11582512/how-to-get-url-parameters-with-javascript/11582513#11582513
function getURLParameter(name) {
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search) || [,""])[1].replace(/\+/g, '%20')) || null;
}
@TRex22
TRex22 / base.js
Created January 6, 2015 14:19
AngularJS Base Controller and page timeout query string
//ref: http://jasonwatmore.com/post/2014/03/25/AngularJS-A-better-way-to-implement-a-base-controller.aspx
//base.js
(function() {
var base = angular.module('base', []);
base.controller('BaseCtrl', function($scope, $location, $timeout, $route) {
var queryStr = $location.search();
if(queryStr.timeout){
var timeoutLengthSec = (queryStr.timeout) * (1000);
$timeout(function(){
$route.reload();
#!/usr/bin/perl
#fetch Gravatars
use strict;
use warnings;
use LWP::Simple;
use Digest::MD5 qw(md5_hex);
my $size = 90;