By: @BTroncone
Also check out my lesson @ngrx/store in 10 minutes on egghead.io!
Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!
Table of Contents
// Primitive hash function that for a string returns a positive 32 bit int | |
// Do not use in production, use murmur3 or fnv1 | |
// You can improve this by changing 5 to 31 | |
Object.defineProperty(String.prototype, 'hashCode', { | |
value: function() { | |
var hash = 0, i, chr; | |
for (i = 0; i < this.length; i++) { | |
chr = this.charCodeAt(i); | |
hash = ((hash << 5) - hash) + chr; | |
hash |= 0; // Convert to 32bit integer |
[ | |
{ | |
"type": "help", | |
"helpvalue": "Complex keys are only supported with AngularJS version 1.3.x, see <a href=\"https://github.com/Textalk/angular-schema-form/blob/master/docs/knownlimitations.md\">known limitations</a> in the docs." | |
}, | |
"title", | |
"preference", | |
{ | |
"key": "shareholders", | |
"title": "Shareholders", |
By: @BTroncone
Also check out my lesson @ngrx/store in 10 minutes on egghead.io!
Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!
Table of Contents
// allcolors.js | |
// https://github.com/bgrins/devtools-snippets | |
// Print out CSS colors used in elements on the page. | |
(function() { | |
'use strict' | |
const BOLD = 'font-weight: bold;' | |
const LINK = 'text-decoration: underline; color: #05f' | |
const NORMAL = 'font-weight: normal; text-decoration: none; color: black; background-color: white; display: inline' |
const I = x => x | |
const K = x => y => x | |
const A = f => x => f (x) | |
const T = x => f => f (x) | |
const W = f => x => f (x) (x) | |
const C = f => y => x => f (x) (y) | |
const B = f => g => x => f (g (x)) | |
const S = f => g => x => f (x) (g (x)) | |
const S_ = f => g => x => f (g (x)) (x) | |
const S2 = f => g => h => x => f (g (x)) (h (x)) |
/*jshint asi:true, proto:true */ | |
/* bling.js */ | |
window.$ = document.querySelectorAll.bind(document) | |
Node.prototype.on = window.on = function(names, fn) { | |
var self = this | |
names.split(' ').forEach(function(name) { |
(function($) { | |
'use strict'; | |
if (typeof $.format === 'function') { | |
return; | |
} | |
// -------------------------------------------------------------------- | |
// Defined variables and constants. | |
/*! | |
* @license jquery-mutation-summary | |
* Copyright © 2012, 2013, 2014, Joel Purra <http://joelpurra.com/> | |
* Released under MIT, BSD and GPL license. Comply with at least one. | |
* | |
* A jQuery wrapper/plugin for mutation-summary, the DOM mutation-observers wrapper. | |
* http://joelpurra.github.com/jquery-mutation-summary | |
* | |
* "Mutation Summary is a JavaScript library that makes observing changes to the DOM fast, easy and safe." | |
* http://code.google.com/p/mutation-summary/ |
// ==UserScript== | |
// @name Github - package.json/bower.json dependency linker | |
// @version 0.0.2 | |
// @namespace http://spiralx.org/github-npm-autolink | |
// @author James Skinner <[email protected]> http://userscripts.org/users/55684 | |
// @description When viewing a package.json file, automatically links dependencies to their NPM page | |
// @include https://github.com/*/package.json | |
// @include https://github.com/*/bower.json | |
// @run-at document-end | |
// @grant unsafeWindow GM_xmlhttpRequest |
(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.