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
var UserList = React.createClass({ | |
propTypes: { | |
onSelect: React.PropTypes.func.isRequired, | |
selection: React.PropTypes.object.isRequired, | |
}, | |
getInitialState() { | |
return { | |
users: [], | |
}; |
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
var PokemonList = React.createClass({ | |
getInitialState() { | |
return { | |
pokemon: [], | |
selection: new Set(), | |
}; | |
}, | |
fetchPokemon() { | |
// Hit API, get pokemon, and set to pokemon on state. |
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
var UserList = React.createClass({ | |
getInitialState() { | |
return { | |
users: [], | |
selection: new Set(), | |
}; | |
}, | |
fetchUsers() { | |
// Hit API, get users, and set to users on state. |
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
function listWrapper(ListComponent) { | |
const ListWrapper = React.createClass({ | |
getInitialState() { | |
return { | |
selection: new Set(), | |
}; | |
}, | |
handleOnSelect(item) { | |
if(this.state.selection.has(item)) { |
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
# nginx | |
description "nginx http daemon" | |
author "George Shammas " | |
start on (filesystem and net-device-up IFACE=lo) | |
stop on runlevel [!2345] | |
env DAEMON=/usr/sbin/nginx | |
env PID=/var/run/nginx.pid |
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
# 1 | |
def new_cat(str1, str2) | |
str1 + str2 | |
end | |
new_cat("Ken ", "Shimizu") | |
# 2 | |
def sum(nums_to_add) | |
nums_to_add.inject(0, :+) |
NewerOlder