#Mac OS X
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
# /etc/monit/monitrc (excerpt) | |
check process node-app with pidfile /var/run/node-app.pid | |
start program = "/sbin/start node-app" with timeout 5 seconds | |
stop program = "/sbin/stop node-app" | |
if failed port 3000 protocol HTTP | |
request / | |
with timeout 3 seconds | |
then restart | |
if cpu > 80% for 10 cycles then restart |
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
// Clone L4 repo | |
git clone -b develop git://github.com/laravel/laravel.git myapp | |
cd myapp | |
// Install Composer | |
curl -sS https://getcomposer.org/installer | php | |
php composer.phar install | |
// Rename origin | |
git remote rename origin upstream |
- If you rename a field, then your users are fucked. Convert with a hardcoded array structure.
- Most DB drivers [for PHP] will show integers as numeric strings and
false
as"0"
, so you want to typecast them. - Unless you're using an ORM with "hidden" functionality, people will see passwords, salts and all sorts of fancy codes. If you add one and forget to put it in your
$hidden
array then OOPS!
- Use the query string for paired params instead of
/users/id/5/active/true
. Your API does not need to be SEO optimised. ?format=xml
is stupid, use anAccept: application/xml
header. I added this to the CodeIgniter Rest Server once for lazy people, and now people think it's a thing. It's not.
The prep-script.sh
will setup the latest Node and install the latest perf version on your Linux box.
When you want to generate the flame graph, run the following (folder locations taken from install script):
sudo sysctl kernel.kptr_restrict=0
# May also have to do the following:
# (additional reading http://unix.stackexchange.com/questions/14227/do-i-need-root-admin-permissions-to-run-userspace-perf-tool-perf-events-ar )
sudo sysctl kernel.perf_event_paranoid=0
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 PostsApi = require('webapi/posts'), | |
// assuming the api object from the jsbin snippet | |
Reflux = require('reflux'); | |
var PostActions = createActions(["load", "loadError"]); | |
// load action is invoked either from: | |
// * top most component's componentDidMount | |
// function in your application, or | |
// * window.onLoad | |
// I prefer the first strategy because that'll |