Skip to content

Instantly share code, notes, and snippets.

View cranesandcaff's full-sized avatar

Patrick Cauley cranesandcaff

View GitHub Profile
import { ReplaySubject } from 'rxjs/ReplaySubject';
import { Directive, Injectable, NgModule } from '@angular/core';
@Injectable()
export class DummyProvider {
constructor() {}
}
@Injectable()
The form example can be written this way to avoid having to register onChange on every field (within the same form):
<form onChange={this.inputHandler}>
...
<input type="text" name="blah" value={this.state.blah}/>
...
</form>
inputHandler: function(event) {
actions.propagateValue({
field: event.target.name,
@cranesandcaff
cranesandcaff / 0_reuse_code.js
Last active August 29, 2015 14:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@cranesandcaff
cranesandcaff / gist:11406364
Created April 29, 2014 17:10
Gulp console out
[gulp] Starting 'styles'...
[gulp] Starting 'reloadSync'...
[gulp] Finished 'reloadSync' after 216 μs
[gulp] Finished 'styles' after 395 ms
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var stylish = require('jshint-stylish');
var mocha = require('gulp-mocha');
var seq = require('run-sequence');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var logger = require('./lib/logger');
var nodemon = require('gulp-nodemon');
var sass = require('gulp-ruby-sass');