This file contains 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
const alb = new awsx.lb.ApplicationLoadBalancer("loadbalancer", { | |
defaultTargetGroup: { | |
port: 3000, | |
healthCheck: { // optional | |
port: "3000", | |
}, | |
}, | |
listener: { | |
port: 80, | |
}, |
This file contains 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 React from 'react'; | |
import { shallow } from 'enzyme'; | |
class ConditionalParent extends React.Component { | |
render() { | |
return !!this.props.visible && (<div>{this.props.children}</div>); | |
} | |
} | |
class Child extends React.Component { |
This file contains 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
const initialState = new Immutable.Map({ | |
email: '', | |
password: '', | |
isLoggingIn: false, | |
isLoggedIn: false, | |
error: null | |
}); | |
export default function user(state = initialState, action) { | |
switch (action.type) { |
This file contains 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
describe("user api tests", function() { | |
it("should add a new user to the database", function(done) { | |
api.put('/user/123') | |
.then(response => { | |
assert.equal(response.statusCode, 201) | |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
table { | |
border-collapse:collapse; | |
} |
This file contains 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
var items = [ | |
... | |
]; | |
var satisfied = items | |
.filter(condition1(5)) | |
.filter(condition2('camel')) | |
.filter(condition3) | |
function condition1(something) { |
This file contains 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
var moment = require('moment'); | |
function Datey() { | |
this.date = moment(); | |
this.modifier = 1; | |
return this; | |
} | |
Datey.prototype.last = function() { | |
this.modifier = -1; |