Skip to content

Instantly share code, notes, and snippets.

View MarcusJT's full-sized avatar

Marcus MarcusJT

View GitHub Profile
@alastaircoote
alastaircoote / gist:5384053
Created April 14, 2013 20:19
Hashchange event hook
var hashChange = function() {
var el = document.getElementById(window.location.hash.substr(1));
$(".activeTr").removeClass("activeTr").find("td").css({
"background":"",
"color":""
});
$(el).parent().addClass("activeTr").find("td").css({
"background":"#08c",
"color":"#fff"
@maskingtape
maskingtape / scriptLoader.js
Created March 25, 2013 10:20
HTML5 boilerplate google analytics script loader generalised to include the font loader
var _gaq=[['_setAccount','UA-XXXXXXX-X'],['_trackPageview']],
WebFontConfig = { google: { families: [ 'Marvel::latin' ]}};
(function(d,t){
function addScript(p, url){
var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?p.s:p.n)+url;
s.parentNode.insertBefore(g,s);
}
addScript({ s: '//ssl', n: '//www'}, '.google-analytics.com/ga.js');
addScript({ s: 'https', n: 'http'}, '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js');
@maskingtape
maskingtape / dabblet.css
Created March 21, 2013 14:08
SVG Data URI Background borders
/**
* SVG Data URI Background borders
*/
body{
background: #fff;
min-height: 100%;
font-family: sans-serif;
}
(function($){
function dragEnter(e) {
$(e.target).addClass("dragOver");
e.stopPropagation();
e.preventDefault();
return false;
};
function dragOver(e) {
e.originalEvent.dataTransfer.dropEffect = "copy";
@rodneyrehm
rodneyrehm / demo-list.html
Created May 28, 2012 11:08
jQuery Snippets - jQuery.sortChildren()
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>sorting lists</title>
<script src="jquery-1.7.2.min.js"></script>
<script src="jquery.sortChildren.js"></script>
<script>
@matthewcrist
matthewcrist / gist:2353575
Created April 10, 2012 18:40
CSS3 translate3d for WebKit
selector {
-webkit-transform: translate3d(0,0,0);
}
* {
-webkit-box-sizing: border-box; /* Safari < 5.1, Chrome < 10 */
-moz-box-sizing: border-box; /* Firefox, other Gecko */
box-sizing: border-box; /* Opera/IE 8+/Safari5.1+/Chrome 10+ */
}
@paulirish
paulirish / rAF.js
Last active March 22, 2024 00:00
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@LeverOne
LeverOne / LICENSE.txt
Created October 24, 2011 04:17 — forked from jed/LICENSE.txt
generate random v4 UUIDs (107 bytes)
DO WTF YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Alexey Silin <pinkoblomingo@gmail.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WTF YOU WANT TO PUBLIC LICENSE
@p01
p01 / LICENSE.txt
Created October 6, 2011 17:11 — forked from 140bytes/LICENSE.txt
Mandelbrot fractal with zoom & panning in 133 bytes
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathieu 'p01' Henri - http://www.p01.org/releases/
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE