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
#!/bin/bash | |
## forever.sh | |
# | |
# Run a script forever, | |
# optionally executing a setup.sh | |
# script after each restart. | |
# | |
SLEEP_TIME=5 |
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
# handy | |
alias l="xscreensaver-command -lock" | |
alias c="clear" | |
alias s="supervisor app.js" | |
alias n="node app.js" | |
# ls | |
alias ls="ls --color=auto" | |
alias la="l -a" |
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
node_modules | |
npm-debug.log |
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
#!/bin/bash | |
# Run this file at boot, as $USER | |
cd ~/app | |
source ~/.env-prod | |
forever start -w --watchDirectory . app.js | |
exit $? |
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
#!/bin/bash | |
app= | |
port= | |
#cmd="~/.venv/bin/gunicorn_django -b 127.0.0.1:$port" | |
cmd="~/nodejs/bin/node app.js" | |
if [ ! -f ~/mon.pid ] | |
then | |
echo '0' > ~/mon.pid |
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
/*jshint browser:true, laxcomma:true, indent: 2, eqnull:true, devel:true */ | |
/*global define */ | |
define('eo', ['vendor/asEvented'], function (asEvented) { | |
'use strict'; | |
var Eo = function (props, name) { | |
if ('string' === typeof props) { | |
this._fromJSON(props); | |
} else { |
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
/*jshint node:true */ | |
'use strict'; | |
var bcrypt = require('bcrypt') | |
, read = require('read'); | |
read({ prompt: 'Password (typing will be hidden): ', silent: true, replace: '*' }, function (err, pass) { | |
var hash = bcrypt.hashSync(pass, 12); | |
process.stdout.write(hash + '\n'); |
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
if (LOGENTRIES_APIKEY) { | |
var logentries_logger = logentries.logger({ | |
token: LOGENTRIES_APIKEY | |
}); | |
coolog.on('log', function (severity, args) { | |
var _logger | |
, le_severity; | |
if (severity === 'debug') { |
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
/*jshint node:true, laxcomma:true, indent:2, white:true, curly:true, plusplus:true, undef:true, strict:true, trailing:true */ | |
'use strict'; | |
/* | |
* LICENSE (MIT) | |
* ============= | |
* | |
* Copyright © 2013 Plastic Panda & others | |
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
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 routes = { | |
'/login': login | |
, '/admin': adminIndex | |
, '/404': function () { alert('404 not found'); router.navigate('/'); } // mandatory | |
}; | |
var router = new Router(routes); | |
router.attach(); | |
router.initial('/login', true); // Forces going to login | |