Skip to content

Instantly share code, notes, and snippets.

import { Component } from "react";
export var Enhance = ComposedComponent => class extends Component {
static displayName = "Enhanced"
constructor() {
super();
this.state = { data: null };
}
componentDidMount() {
server{
listen 80;
server_name example.com;
access_log /home/path_to_site/access.log;
error_log /home/path_to_site/error.log;
location / {
proxy_pass http://0.0.0.0:8002;
proxy_set_header Host $host;
angular.module('app.resources', ['ngResource'])
.factory('api', function ($resource) {
var api = {
defaultConfig : {id: '@id'},
extraMethods: {
'update' : {
method: 'PUT'
}
sinon / chai / mocha / js-tests
_____________________________________
#### chai
expect(subject).not.equal(expected)
.a('string')
.instanceof(Foo)
// see this article: http://lostechies.com/derickbailey/2012/05/10/modeling-explicit-workflow-with-code-in-javascript-and-backbone-apps/
// replace the object literal in that example with a Marionette.Controller
//
// an example:
var SomeProcess = Marionette.Controller.extend({
initialize: function(options){
this.region = options.region;
this.model = options.model;
},
console.clear();
var dest = {
foo : {
b1 : "b1 value",
b2 : "b2 value"
},
baz : {
q1 : "q1 value"
},