Skip to content

Instantly share code, notes, and snippets.

sudo killall racoon
@ardysnippets
ardysnippets / auto_refresh.js
Created March 13, 2012 14:54
JavaScript: Auto-refresh/loading of dynamic data
$(function() {
var auto_refresh = setInterval(
function(){
console.log(Math.random());
},
1000
);
});
@ardysnippets
ardysnippets / gist:2027415
Created March 13, 2012 07:26
CSS: Cross-browser gradient
background: #40464e;
background-image: -khtml-gradient(linear, left top, left bottom, from(#40464e), to(#2d333b));
background-image: -moz-linear-gradient(top, #40464e, #2d333b);
background-image: -ms-linear-gradient(top, #40464e, #2d333b);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #40464e), color-stop(100%, #2d333b));
background-image: -webkit-linear-gradient(top, #40464e, #2d333b);
background-image: -o-linear-gradient(top, #40464e, #2d333b);
background-image: linear-gradient(top, #40464e, #2d333b);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#40464e', endColorstr='#2d333b', GradientType=0);
@ardysnippets
ardysnippets / gist:2027408
Created March 13, 2012 07:22
JavaScript: Auto-adjust footer position
/**
* Global JS file
*/
$(function() {
// adjust the footer position
setInterval(function(){
var footer = '.footer';
var resize = $('.container').height() + $(footer).height() > $(window).height();
$(footer).css({"position": resize ? "static" : "fixed"});
$('body').css({"height":($(document).height() - $(footer).height()) + "px"});
@ardysnippets
ardysnippets / gist:2027396
Created March 13, 2012 07:17
HTML: Boilerplate Starting Template
<!doctype html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!-- Consider adding a manifest.appcache: h5bp.com/d/Offline -->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
@ardysnippets
ardysnippets / gist:2027374
Created March 13, 2012 07:09
shell show filesize of one file
ls -lah (filename) | awk '{ print $5 }'