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
module.exports = cache; | |
/** | |
* creates a cache around the given async function. | |
* | |
* @example | |
* function waitAndResolve(time, value, callback) { | |
* setTimeout(function() { | |
* callback(null, value); | |
* }, time); |
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 fs=require('fs'), | |
Canvas = require('Canvas'); | |
/** | |
* algorithm impudently stolen from http://www.noisetexturegenerator.com/ | |
*/ | |
var generateNoise = function(width, height, opacity, density) { | |
var canvas = new Canvas(width, height), | |
ctx = canvas.getContext('2d'); |
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 audioContext = new webkitAudioContext(), | |
osc1 = audioContext.createOscillator(), | |
osc2 = audioContext.createOscillator(); | |
osc1.frequency.value = 440; // Hz | |
osc2.frequency.value = 220; // one octave down | |
osc1.connect(audioContext.destination); | |
osc2.connect(audioContext.destination); |
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="carousel"> | |
<a class="prev" href="#">prev</a> | |
<div class="slide-container"> | |
<div class="slide center"><!-- ... --></div> | |
<div class="slide right"><!-- ... --></div> | |
<div class="slide hidden"><!-- ... --></div> | |
<div class="slide hidden"><!-- ... --></div> | |
<div class="slide hidden"><!-- ... --></div> | |
<div class="slide left"><!-- ... --></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
// DISCLAIMER: errors and worst-practice examples are fully intentional | |
// our starting-point | |
(function($, window) { | |
'use strict'; | |
$(document).on('mousemove', function(ev) { | |
$('.follow').css('left', ev.pageX - $('.follow').width()/2); | |
$('.follow').css('top', ev.pageY - $('.follow').height()/2); | |
}); |
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== | |
// @id ingress-intel-total-conversion@breunigs | |
// @name intel map total conversion | |
// @version 0.6-2013-02-21-171155 | |
// @namespace https://github.com/breunigs/ingress-intel-total-conversion | |
// @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/dist/total-conversion-build.user.js | |
// @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/dist/total-conversion-build.user.js | |
// @description total conversion for the ingress intel map. | |
// @include http://www.ingress.com/intel* | |
// @match http://www.ingress.com/intel* |
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
.slide-container { | |
@include transform-style(preserve-3d); | |
@include perspective(2000px); | |
.slide { | |
opacity: 0; | |
@include transition(transform 800ms, opacity 800ms); | |
&.current { opacity: 1; @include transform(rotateY(0deg)); } | |
&.left { @include transform(rotateY(-90deg) translateZ(800px)); } |
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
/** | |
* content-box shadows part II | |
*/ | |
body { | |
background-color: #666; } | |
.container { | |
width: 80%; height: 800px; | |
border-radius: 20px; | |
box-shadow: 0 0 20px 0 black; |
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
/** | |
* content-box shadows part II | |
*/ | |
body { | |
background-color: #666; } | |
.container { | |
width: 80%; height: 800px; | |
border-radius: 20px; | |
box-shadow: 0 0 20px 0 black; |
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
/** | |
* content-box shadows part I | |
*/ | |
body { | |
background-color: #666; } | |
.container { | |
width: 80%; height: 800px; | |
border-radius: 50px; | |
overflow: hidden; |