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
/* Doubly Linked List implementation */ | |
#include<stdio.h> | |
#include<stdlib.h> | |
struct Node { | |
int data; | |
struct Node* next; | |
struct Node* prev; | |
}; |
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
#! /usr/bin/env bash | |
# Install any build dependencies needed for curl | |
sudo apt-get build-dep curl | |
# Get latest (as of Feb 25, 2016) libcurl | |
mkdir ~/curl | |
cd ~/curl | |
wget http://curl.haxx.se/download/curl-7.50.2.tar.bz2 | |
tar -xvjf curl-7.50.2.tar.bz2 |
// getComponent is a function that returns a promise for a component | |
// It will not be called until the first mount | |
function asyncComponent(getComponent) { | |
return class AsyncComponent extends React.Component { | |
static Component = null; | |
state = { Component: AsyncComponent.Component }; | |
componentWillMount() { | |
if (!this.state.Component) { | |
getComponent().then(Component => { |
(function () { | |
'use strict'; | |
angular.module('myApp') | |
.controller('SomeCtrl', SomeCtrl); | |
SomeCtrl.$inject = ['$scope', '$http', ' alertService']; | |
function SomeCtrl($scope, $http, alertService) { | |
$http.put('http://some.url/user/44', { |
<?php | |
class EloquenFooRepository | |
{ | |
/** | |
* The base eloquent model | |
* @var Eloquent | |
*/ | |
protected $model; |
version: '2' | |
services: | |
traefik: | |
image: traefik | |
command: -c /dev/null --web --docker --docker.domain=docker.localhost --logLevel=DEBUG --entryPoints="Name:https Address::443 TLS:/certs/server.crt,/certs/server.key;/certs_br/server.crt,/certs_br/server.key" --entryPoints="Name:http Address::80 Redirect.EntryPoint:https" | |
ports: | |
- "80:80" | |
- "8080:8080" |
alias homestead='function __homestead() { (cd ~/Documents/Code/Homestead && vagrant $*); unset -f __homestead; }; __homestead' | |
# Usage | |
homestead up | |
homestead halt | |
# etc... |
const lookup = (namespace) => { | |
// if you really want rails-style indirection, you'd | |
// need an app container that could look up modules | |
// by strings. | |
} | |
const Resources = ({ namespace }) => { | |
const Layout = lookup(namespace, 'layout') | |
return ( | |
<Route path={`/${namespace}`} render={() => ( |
# Name it whatever you want. I like `y` because in my keyboard layout it's close to `;` | |
function y() { | |
previous=$? | |
if [ $previous -eq 0 ]; then | |
osascript -e "display notification \"Done\" with title \"Terminal Task\"" && say "it is done"; | |
else | |
osascript -e "display notification \"Failed\" with title \"Terminal Task\"" && say "it went to the trees"; | |
fi | |
} |