Skip to content

Instantly share code, notes, and snippets.

@csessig86
csessig86 / Social buttons.css
Created November 5, 2013 22:55
Facebook, Twitter buttons
/***** Social buttons *****/
.share {
width: 100%;
z-index: 100000000;
}
#share-main {
padding-top: 65px;
}
@csessig86
csessig86 / DataTables: Formatted number.js
Created November 5, 2013 22:58
Format number column with DataTables
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
"formatted-num-pre": function ( a ) {
a = (a === "-" || a === "") ? 0 : a.replace( /[^\d\-\.]/g, "" );
return parseFloat( a );
},
"formatted-num-asc": function ( a, b ) {
return a - b;
},
@csessig86
csessig86 / DataTables: Percent.js
Created November 5, 2013 22:59
Format percent column with DataTables
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
"percent-pre": function ( a ) {
var x = (a == "-") ? 0 : a.replace( /%/, "" );
return parseFloat( x );
},
"percent-asc": function ( a, b ) {
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
},
@csessig86
csessig86 / meta-tags.html
Last active February 17, 2016 15:11
Meta tags
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
<link rel="shortcut icon" href="imgs/glogo.png" />
<!-- Mobile meta tags-->
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="apple-touch-fullscreen" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes">
@csessig86
csessig86 / jQuery mobile: Remove loading text.js
Created November 5, 2013 23:06
Remove the word 'loading' from the bottom of jQuery mobile apps
$.mobile.loadingMessage = false;
@csessig86
csessig86 / jQuery mobile: Working links.html
Created November 5, 2013 23:07
Add this tag to get links to work properly with jQuery mobile
@csessig86
csessig86 / Add commas.js
Created November 5, 2013 23:08
Function that adds commas to numbers 1,000 or greater
function numberFormat(nStr){
nStr += '';
x = nStr.split('.');
x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1))
x1 = x1.replace(rgx, '$1' + ',' + '$2');
return x1 + x2;
}
@csessig86
csessig86 / Universal styles.css
Created November 5, 2013 23:10
Universal styles for news apps
/***** Universal styles *****/
html, body {
padding: 0px;
margin: 0px;
padding-right:1px;;
}
body {
font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
font-size: 13px;
@csessig86
csessig86 / Courier header.css
Created November 5, 2013 23:11
Courier header for news apps outside CMS
<!-- Header -->
<div id="header-container" class="header-footer">
<h4><a href="#WaterlooCI" data-ajax="false">Election 2013</a></h4>
<a href="http://wcfcourier.com/">
<img id="courier-logo" src="images/WCFCourier_LOGO_BW_300px.png" />
</a>
</div>
@csessig86
csessig86 / Bootstrap bar charts.css
Created November 5, 2013 23:13
Bar charts with Bootstrap. As used with election 2013 website
<table class='vote-results-table'>
<tr>
<td >
<div class='vote-results-header'>Results</div>
</td>
</tr>
{{#each candidates}}
<tr>
<td width='250px'><strong>{{candidate}}</strong>: {{votes}} votes</td>
</tr>