(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
var gallery = require('./page-gallery') | |
var popup = require('./info-popup') | |
gallery.show() | |
//once all elements in the page are done animating, do something else | |
.then(function() { | |
return popup.show() | |
}) |
/* | |
* | |
* Use: | |
* var textPages = textToPages(myElement) | |
* returns array of strings. | |
* | |
*/ | |
var textToPages = function(element) { | |
var pages = []; |
/** | |
* lol() | |
* improving the console.log through dynamic LULZ injection | |
* | |
* history | |
* - v0.0 RC - 2014-08-08 - 13h01 : initial release | |
* - v0.1 RC - 2014-08-08 - 13h29 : DogeScript support | |
* | |
* Licensed under WTFPL | |
* |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
// Modified version of a tilt shift shader from Martin Jonasson (http://grapefrukt.com/) | |
// Read http://notes.underscorediscovery.com/ for context on shaders and this file | |
// License : MIT | |
uniform sampler2D tex0; | |
varying vec2 tcoord; | |
varying vec4 color; | |
/* | |
Take note that blurring in a single pass (the two for loops below) is more expensive than separating |
// === Arrays | |
var [a, b] = [1, 2]; | |
console.log(a, b); | |
//=> 1 2 | |
// Use from functions, only select from pattern | |
var foo = () => [1, 2, 3]; |
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');
Those suck for maintenance and they're ugly.
;(function(root) { | |
/* | |
this module return methods for having resize collections bound to a timer; | |
use like this: | |
resizeCollection.register(function, ms) | |
If ms is null, will push the function to the 500ms timer. | |
If ms is given, will create a new resize timer. | |
*/ | |
var lastTimer = 2000, |
#!/bin/bash | |
# | |
# This script configures WordPress file permissions based on recommendations | |
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
# | |
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org> | |
# | |
WP_OWNER=www-data # <-- wordpress owner | |
WP_GROUP=www-data # <-- wordpress group | |
WP_ROOT=$1 # <-- wordpress root directory |