This file contains hidden or 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 split_to_array (body, chunklen) { | |
// * example 1: chunk_split('Hello world!', 1); | |
// * returns 1: 'H*e*l*l*o* *w*o*r*l*d*!*' | |
// * example 2: chunk_split('Hello world!', 10, '*'); | |
// * returns 2: '["Hello worl","d!"]' | |
chunklen = parseInt(chunklen, 10) || body.length; | |
if (chunklen < 1) { | |
return false; | |
} |
This file contains hidden or 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 chunk_split (body, chunklen, end) { | |
// http://kevin.vanzonneveld.net | |
// + original by: Paulo Freitas | |
// + input by: Brett Zamir (http://brett-zamir.me) | |
// + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) | |
// + improved by: Theriault | |
// * example 1: chunk_split('Hello world!', 1, '*'); | |
// * returns 1: 'H*e*l*l*o* *w*o*r*l*d*!*' | |
// * example 2: chunk_split('Hello world!', 10, '*'); | |
// * returns 2: 'Hello worl*d!*' |
This file contains hidden or 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
// reusable sort functions, and sort by any field | |
// UsagesSort by price high to low | |
// homes.sort(sort_by('price', true, parseInt)); | |
// Sort by city, case-insensitive, A-Z | |
// homes.sort(sort_by('city', false, function(a){return a.toUpperCase()})); | |
var sort_by = function(field, reverse, primer){ | |
var key = function (x) {return primer ? primer(x[field]) : x[field];}; | |
return function (a,b) { | |
var A = key(a), B = key(b); |
This file contains hidden or 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
// Google Analystics Script: Track page scroll | |
// All you need is to add where _gaq defined: | |
// https://github.com/h5bp/html5-boilerplate/wiki/ga-augments | |
$(function(){ | |
var isDuplicateScrollEvent, | |
scrollTimeStart = new Date, | |
$window = $(window), | |
$document = $(document), | |
scrollPercent; |
This file contains hidden or 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
Show hidden characters
{ | |
"font_size": 12, | |
"tab_size": 2, | |
"translate_tabs_to_spaces": true, | |
"draw_white_space": "all" | |
} |
This file contains hidden or 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
Afghanistan | |
Albania | |
Algeria | |
Andorra | |
Angola | |
Antigua & Deps | |
Argentina | |
Armenia | |
Australia | |
Austria |
This file contains hidden or 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
[Oo]bj | |
[Bb]in | |
*.user | |
*.suo | |
*.[Cc]ache | |
*.bak | |
*.ncb | |
*.log | |
*.DS_Store | |
[Tt]humbs.db |
This file contains hidden or 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
p:before { | |
content: ""; | |
width: 10em; | |
display: block; | |
overflow: hidden; | |
/* For Demonstration */ | |
border: 1px solid green; | |
} |
This file contains hidden or 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(d, t) { | |
var g = d.createElement(t), | |
s = d.getElementsByTagName(t)[0]; | |
g.src = '//third-party.com/resource.js'; | |
s.parentNode.insertBefore(g, s); | |
}(document, 'script')); |
This file contains hidden or 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
<?php | |
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ | |
/** | |
* Short description for file | |
* | |
* Long description for file (if any)... | |
* | |
* PHP version 5 |