This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://gist.github.com/natbat/b283b8fb6560dbc4ace2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Check this out... ‮this is backwards‬ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--[if lte IE 6]><![if gte IE 7]><![endif]--> | |
<!-- This is a bit mad, but code inside here is served to everything except browsers less than IE7 --> | |
<!--[if lte IE 6]><![endif]><![endif]--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wait(millis) { | |
var date = new Date(); | |
var curDate = null; | |
do { | |
curDate = new Date(); | |
} while(curDate-date < millis); | |
var date = null; | |
var curDate = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ((location.href.split('?')[1] || '').indexOf('print') > -1) { | |
/* assuming all other stylesheets are on media all, this means you can use the ?print query string to preview print styles */ | |
$('link[media=print]').attr('media', ''); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Console-polyfill. MIT license. | |
// https://github.com/paulmillr/console-polyfill | |
// Make it safe to do console.log() always. | |
(function(global) { | |
'use strict'; | |
global.console = global.console || {}; | |
var con = global.console; | |
var prop, method; | |
var empty = {}; | |
var dummy = function() {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
warning = false; | |
window.onbeforeunload = function() { | |
if (warning) { | |
return 'You have made changes on this page that you have not yet confirmed. If you navigate away from this page you will loose your unsaved changes'; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="list-person g-group"> | |
<ul> | |
<li class="g-cell g-cell-1-1 g-cell-md-1-3 g-cell-lg-1-4"> | |
<img src="http://dummyimage.com/320x320/000/fff.jpg" alt="" class="list-person--image"> | |
<h3 class="list-person--name">Anthony Edward Stark</h3> | |
<p>Stark Industries</p> | |
<p>Iron man</p> | |
</li> | |
<li class="g-cell g-cell-1-1 g-cell-md-1-3 g-cell-lg-1-4"> | |
<img src="http://dummyimage.com/320x320/000/fff.jpg" alt="" class="list-person--image"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function time_since($original) { | |
// array of time period chunks | |
$chunks = array( | |
array(60 * 60 * 24 * 365 , 'year'), | |
array(60 * 60 * 24 * 30 , 'month'), | |
array(60 * 60 * 24 * 7, 'week'), | |
array(60 * 60 * 24 , 'day'), | |
array(60 * 60 , 'hour'), | |
array(60 , 'minute'), | |
); |
OlderNewer