This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component } from "react"; | |
| export var Enhance = ComposedComponent => class extends Component { | |
| static displayName = "Enhanced" | |
| constructor() { | |
| super(); | |
| this.state = { data: null }; | |
| } | |
| componentDidMount() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| angular.module('app.resources', ['ngResource']) | |
| .factory('api', function ($resource) { | |
| var api = { | |
| defaultConfig : {id: '@id'}, | |
| extraMethods: { | |
| 'update' : { | |
| method: 'PUT' | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sinon / chai / mocha / js-tests | |
| _____________________________________ | |
| #### chai | |
| expect(subject).not.equal(expected) | |
| .a('string') | |
| .instanceof(Foo) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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; | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| console.clear(); | |
| var dest = { | |
| foo : { | |
| b1 : "b1 value", | |
| b2 : "b2 value" | |
| }, | |
| baz : { | |
| q1 : "q1 value" | |
| }, |
NewerOlder