(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.
.filter("timeago", function () { | |
//time: the time | |
//local: compared to what time? default: now | |
//raw: wheter you want in a format of "5 minutes ago", or "5 minutes" | |
return function (time, local, raw) { | |
if (!time) return "never"; | |
if (!local) { | |
(local = Date.now()) | |
} |
### | |
# Based on: | |
# jQuery JavaScript Library v1.4.2 | |
# http://jquery.com/ | |
# | |
# Copyright 2010, John Resig | |
# Dual licensed under the MIT or GPL Version 2 licenses. | |
# http://jquery.org/license | |
### |
//Works for 1.1.x versions. 1.0.x is similar and can be figured out using code comments | |
myapp.factory('myHttpResponseInterceptor',['$q','$location',function($q,$location){ | |
return { | |
response: function(response){ | |
return promise.then( | |
function success(response) { | |
return response; | |
}, | |
function error(response) { | |
if(response.status === 401){ |
license: gpl-3.0 | |
height: 960 | |
redirect: https://observablehq.com/@d3/d3-zoomable-circle-packing |
class nodejs { | |
exec { 'nvm-install': | |
command => '/usr/bin/curl https://raw.github.com/creationix/nvm/master/install.sh | /bin/sh', | |
creates => '/home/vagrant/.nvm', | |
user => 'vagrant', | |
environment => 'HOME=/home/vagrant', | |
require => Package['curl'] | |
} |
var module = angular.module( 'my.resource', [ 'ngResource' ] ); | |
module.factory( 'Resource', [ '$resource', function( $resource ) { | |
return function( url, params, methods ) { | |
var defaults = { | |
update: { method: 'put', isArray: false }, | |
create: { method: 'post' } | |
}; | |
methods = angular.extend( defaults, methods ); |
'use strict'; | |
var gulp = require('gulp'); | |
var gutil = require('gulp-util'); | |
var del = require('del'); | |
var uglify = require('gulp-uglify'); | |
var gulpif = require('gulp-if'); | |
var exec = require('child_process').exec; | |
var notify = require('gulp-notify'); |
function objectToQuerystring (obj) { | |
return Object.keys.reduce(function (str, key, i) { | |
var delimiter, val; | |
delimiter = (i === 0) ? '?' : '&'; | |
key = encodeURIComponent(key); | |
val = encodeURIComponent(obj[key]); | |
return [str, delimiter, key, '=', val].join(''); | |
}, ''); | |
} |
/** @jsx React.DOM */ | |
'use strict'; | |
var RepeaterRow = React.createClass({ | |
render: function() { | |
return <div>Repeater Row {this.props['data-ex']}</div>; | |
} |
(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.