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 | |
| /** | |
| * Insert an array in another array | |
| * @param : (array) &$array, our main array | |
| * @param : (array) $insert, the array we want to insert | |
| * @param : (integer) $position, where we want to insert the array | |
| */ | |
| function array_insert(Array &$array, Array $insert, $position) | |
| { |
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
| #Packages required to build sources : | |
| apt-get install build-essential | |
| #Download nodejs sources : | |
| wget http://nodejs.org/dist/v0.10.26/node-v0.10.26.tar.gz | |
| #Extract the tar archive : | |
| tar zxvf node-v0.10.26.tar.gz | |
| #Make sure gcc, g++ and make are enabled |
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 fixInfoWindow() { | |
| //Here we redefine set() method. | |
| //If it is called for map option, we hide InfoWindow, if "noSupress" option isnt true. | |
| //As Google doesn't know about this option, its InfoWindows will not be opened. | |
| var set = google.maps.InfoWindow.prototype.set; | |
| google.maps.InfoWindow.prototype.set = function (key, val) { | |
| if (key === 'map') { | |
| if (!this.get('noSupress')) { | |
| console.log('This InfoWindow is supressed. To enable it, set "noSupress" option to true'); | |
| return; |
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
| .arrow-up { | |
| width: 0; | |
| height: 0; | |
| border-left: 10px solid transparent; | |
| border-right: 10px solid transparent; | |
| border-bottom: 10px solid black; | |
| } | |
| .arrow-down { |
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
| /* | |
| * Dependencies | |
| * - Bowser : https://github.com/ded/bowser | |
| * - Smoke : https://github.com/hxgf/smoke.js | |
| */ | |
| /* | |
| * Detect which browser is used and it's version to automaticaly redirect the user on the browser's download page if the version is quite old | |
| */ |
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
| /** | |
| * @author mrdoob / http://mrdoob.com/ | |
| */ | |
| /** | |
| * Just call in the body : | |
| * | |
| * // Stats | |
| * var stats = new stats(); | |
| * |
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 | |
| /** | |
| * Autoloader class | |
| * @author Thomas Collot | |
| */ | |
| namespace Light\App; | |
| class Autoload | |
| { |
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 JSON_stringify(s, emit_unicode) | |
| { | |
| var json = JSON.stringify(s); | |
| return emit_unicode ? json : json.replace(/[\u007f-\uffff]/g, | |
| function(c) { | |
| return '\\u'+('0000'+c.charCodeAt(0).toString(16)).slice(-4); | |
| } | |
| ); | |
| } |
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
| var postData = querystring.stringify({ | |
| grant_type: "password", | |
| username: "<username>", | |
| password: "<password>", | |
| client_id: "ghost-admin" | |
| }); | |
| var uriBase = '/ghost/api/v0.1/'; | |
| var requestOptions = { |
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
| /** | |
| * Light color detection | |
| * source : http://en.wikipedia.org/wiki/YIQ | |
| */ | |
| var light = function(hex) { | |
| var r = parseInt(hex.substr(0, 2), 16); | |
| var g = parseInt(hex.substr(2, 2), 16); | |
| var b = parseInt(hex.substr(4, 2), 16); | |
| var yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000; | |
| return yiq <= 196; |
OlderNewer