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 api_fetch = { | |
checkStatus(response) { | |
if (response.status >= 200 && response.status < 300) { | |
return Promise.resolve(response); | |
} else { | |
return Promise.reject(response); | |
} | |
}, | |
parseJson(response) { |
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
when you do not need a router | |
then we can escape by mounting and unmounting components manually | |
also can we hook `history.js` into mount and unmount to get a stupid router ? |
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 App = React.createClass({ | |
getInitialState: function() { | |
return { | |
red: 0, | |
green: 0, | |
blue: 0 | |
}; | |
}, | |
update: function() { |
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
"use strict"; | |
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | |
var state = { | |
loggedIn: false | |
}; | |
var newState = _extends({}, state, { | |
loggedIn: "test" |
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
## Install [node](http://nodejs.org) via [homebrew](http://brew.sh) and update [npm](https://www.npmjs.com) | |
# install node version with LTS (Long Term Support) | |
brew install node4-lts | |
# update npm | |
npm install npm -g | |
# check versions | |
node -v |
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
require 'benchmark' | |
require 'set' | |
NUMBERS = 5000.times.collect { rand(10) } | |
Benchmark.bmbm do |x| | |
x.report("set") do | |
set = Set.new | |
NUMBERS.each do |number| | |
set.add number |
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
# provisioning a rails stack with | |
# - ngixn web server and reverse proxy | |
# - puma app server | |
# - redis | |
# - elasticsearch | |
# - Amazon RDS using etc for the SQL database | |
# installed on an AWS EC2 instance running Ubuntu 14.04 LTS | |
# fix locale. | |
# needed to remove login warning |
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
as a rust noob and coming from ruby | |
was confused why we need `extern crate` and `use` both ? | |
the `guessing-game` chapter has these two paragraphs: | |
``` | |
The first thing we’ve done is change the first line. It now says | |
`extern crate rand`. Because we declared `rand` in our `[dependencies]`, we | |
can use `extern crate` to let Rust know we’ll be making use of it. This also | |
does the equivalent of a `use rand;` as well, so we can make use of anything |
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
1. view paths ? | |
2. where are the layout and view file located ? | |
3. is the database.yml valid ? | |
sanity check: eyeball if it is running locally. | |
4. any "very" old libs and/or known security vulnerabilities ? | |
for (1) can delete a partial and see the stacktrace | |
something like |
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
[root] | |
name = "hello_world" | |
version = "0.0.1" | |
dependencies = [ | |
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", | |
] | |
[[package]] | |
name = "libc" | |
version = "0.2.10" |