(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.
function loadDev(){ | |
var jq = document.createElement("script"); | |
jq.setAttribute("src","http://code.jquery.com/jquery-2.1.0.js") | |
document.head.appendChild(jq); | |
var us = document.createElement("script"); | |
us.setAttribute("src","http://underscorejs.org/underscore.js") | |
document.head.appendChild(us); | |
console.log("Loaded Jquery and Underscore") | |
} | |
loadDev() |
(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.
Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative
float rand(float n){return fract(sin(n) * 43758.5453123);}
float noise(float p){
float fl = floor(p);
float fc = fract(p);
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent
// Minimum viable app.ts pulled from https://github.com/driftyco/ionic2-starter-blank/tree/41b4da8329636a95ab05d2579efd3a1527d2e830 | |
// This snapshot is likely [email protected] compatable | |
import 'es6-shim'; | |
import {App, Platform} from 'ionic-angular'; | |
import {StatusBar} from 'ionic-native'; | |
import {HomePage} from './pages/home/home'; | |
@App({ | |
template: '<ion-nav [root]="rootPage"></ion-nav>', |
import {PipeTransform, Pipe} from 'angular2/core'; | |
@Pipe({ name: 'highlight' }) | |
export class HighLightPipe implements PipeTransform { | |
transform(text: string, [search]): string { | |
return search ? text.replace(new RegExp(search, 'i'), `<span class="highlight">${search}</span>`) : text; | |
} | |
} | |
/** Usage: |
var UInt4 = function (value) { | |
return (value & 0xF); | |
}; | |
var Int4 = function (value) { | |
var ref = UInt4(value); | |
return (ref > 0x7) ? ref - 0x10 : ref; | |
}; | |
var UInt8 = function (value) { |
# Clone entire site. | |
wget --content-disposition --execute robots=off --recursive --no-parent --continue --no-clobber http://example.com | |
# Remove query string from a static resource. | |
for i in `find $1 -type f -name "*\?*"`; do mv $i `echo $i | cut -d? -f1`; done |