This file contains 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 chai = require('chai'); | |
var assert = chai.assert; | |
var expect = chai.expect; | |
var should = chai.should(); | |
var sinon = require('sinon'); | |
function myAsyncFunction(callback) { | |
// 50ms delay before callback | |
setTimeout(function() { | |
console.log('hello'); |
This file contains 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 express = require('express'); | |
var app = express(); | |
app.use('/totem', express.static(__dirname + '/totem')); | |
app.use('/remote', express.static(__dirname + '/remote')); | |
app.use('/minisite', express.static(__dirname + '/minisite')); | |
ap.get('/', function(req, res) { | |
res.send('<a href="/minisite">minisite</a><br>'); | |
res.send('<a href="/remote">remote</a><br>'); |
This file contains 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
<head> | |
<style> | |
section { | |
padding:2em 1.5em 1.5em 1.5em; | |
font-size:2em; | |
background:yellow; | |
font-family:sans; | |
position:relative; | |
overflow:hidden; | |
} |
This file contains 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
<html> | |
<head> | |
<style> | |
.grid *:first-child:nth-last-child(1) { | |
width: 100%; | |
} | |
.grid *:first-child:nth-last-child(2), | |
.grid *:first-child:nth-last-child(2) ~ * { | |
width: 50%; |
This file contains 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
// ==UserScript== | |
// @match http://*.ogame.gameforge.com/game/* | |
// @name OGame UI++ | |
// @author Eswak | |
// @version 1.1.0 | |
// @description Améliore l'interface utilisateur d'OGame en y ajoutant des éléments. | |
// @icon http://gf1.geo.gfsrv.net/cdn68/20da7e6c416e6cd5f8544a73f588e5.png | |
// DESCRIPTION : | |
// This userscript enhances the ogame UI to add some informations into it | |
// HOW TO INSTALL (GOOGLE CHROME) : |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
svg.progress-circle { | |
height: 1em; | |
} | |
svg.progress-circle text { | |
fill: #003484; | |
font-family: 'Roboto', arial; |
This file contains 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 closure () { | |
// progressively draw each <svg> without .no-draw class | |
Array.prototype.forEach.call(document.querySelectorAll('svg:not(.no-draw)'), function(svg) { | |
// animation duration & delay (default values overriden by data attributes) | |
var animationTimeInSeconds = Number(svg.getAttribute('data-draw-time')) || 2; | |
var animationStartDelay = Number(svg.getAttribute('data-draw-start-delay'))*1000 || 0; | |
// init, hide all svgs | |
var totalFrames = animationTimeInSeconds * 60; |
This file contains 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
<div class="paper"> | |
<div class="paper-section"> | |
Hello ! | |
</div> | |
</div> | |
<div class="paper"> | |
<div class="paper-section"> | |
Hello ! | |
</div> |
This file contains 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 str2num (str) { | |
var hash = 0, i, chr, len; | |
if (str == 0) return hash; | |
for (i = 0, len = str.length; i < len; i++) { | |
chr = str.charCodeAt(i); | |
hash = ((hash << 5) - hash) + chr; | |
hash |= 0; | |
} | |
return hash; | |
}; |
This file contains 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
/* | |
* Flattens an object by creating a plain object (without nested keys). | |
* The returned object keys are strings with dots for nested source object. | |
* Example : | |
* flattenObj({ a: 1, b: { c: 2, d: null } }) => { 'a': 1, 'b.c': 2, 'b.d': null } | |
*/ | |
function flattenObj (obj, prefix, acc) { | |
acc = acc || {}; | |
prefix = prefix || ''; | |
var separator = '.'; |
OlderNewer