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
-- Doesn't work (returns affiliation = null): | |
SELECT dating.*, | |
CASE WHEN dating.traditional = choices.id AND choices.cat = 'trad' THEN choices.choice END as affiliation | |
FROM dating, choices | |
LIMIT 1 | |
-- Works: | |
SELECT dating.*, choices.choice as affiliation |
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
# make rbenv work | |
eval "$(rbenv init -)" | |
# set up useful alias | |
alias ll='ls -la' | |
# tell ls to be colorful | |
export CLICOLOR=1 | |
export LSCOLORS=ExFxCxDxBxegedabagacad |
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
```shell | |
remote: npm http 304 https://registry.npmjs.org/uglify-js/1.2.5 | |
remote: npm http 304 https://registry.npmjs.org/xmlhttprequest/1.2.2 | |
remote: npm http 304 https://registry.npmjs.org/active-x-obfuscator/0.0.1 | |
remote: npm http 304 https://registry.npmjs.org/ws | |
remote: npm ERR! git checkout master fatal: Not a git repository: '.' | |
remote: | |
remote: npm ERR! Error: `git "checkout" "master"` failed with 128 | |
remote: npm ERR! at ChildProcess.<anonymous> (/home/prod_web1/local/lib/node_modules/npm/lib/utils/exec.js:58:20) | |
remote: npm ERR! at ChildProcess.emit (events.js:70:17) |
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 Profile = new mongoose.Schema({ | |
// ... properties all around this omitted | |
fixed : { | |
displayname: { type: String }, | |
birthday: { type: Date } | |
} | |
}, {strict: true, minimize: false}); | |
// ...used findOne() to retrieve `req.profile` |
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
rm -rf /usr/local/{lib/node_modules,share/man/*,bin,etc}/npm* ~/.npm ~/.npmrc |
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
npm http GET https://registry.npmjs.org/express-resource/0.2.4 | |
npm http 304 https://registry.npmjs.org/base12/0.2.9 | |
npm http 304 https://registry.npmjs.org/handlebars/1.0.5beta | |
npm http 404 https://registry.npmjs.org/express/3.0.0alpha1-pre | |
npm ERR! Error: version not found: 3.0.0alpha1-pre : express/3.0.0alpha1-pre | |
npm ERR! at Request._callback (/opt/nodejs/v0.6.8/lib/node_modules/npm/lib/utils/npm-registry-client/request.js:181:12) | |
npm ERR! at Request.callback (/opt/nodejs/v0.6.8/lib/node_modules/npm/node_modules/request/main.js:119:22) | |
npm ERR! at Request.<anonymous> (/opt/nodejs/v0.6.8/lib/node_modules/npm/node_modules/request/main.js:605:16) | |
npm ERR! at Request.emit (events.js:67:17) |
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
hunter:~/work/base12$ scripts/provision/provision -si 165.225.129.25 config/web.server.json | |
Provisioning 165.225.129.25 | |
Using /Users/hunter/work/base12/config/web.server.json | |
=== Setup === | |
Setting up for Joyent | |
Config is: { type: 'joyent', install: [ 'redis', 'mongodb', 'node' ] } | |
EXECUTING: ssh [email protected] 'bash -s' < /Users/hunter/work/base12/scripts/provision/joyent/setup.sh | |
CODE: null |
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 express = require('express'); | |
var app = express.createServer(); | |
app.use(express.bodyParser()); | |
app.use(app.router); | |
app.get('/', function(req, res) { | |
req.send('hello, world'); | |
}); |
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(exports, $, otherLibrariesYouNeed) { | |
var localVariable = 'This is bound in the closure, so I will not create accidental globals.'; | |
function PrivateFunction() { | |
} | |
function MyConstructor() { | |
this.property = 'something'; |
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
# --- setup.sh: | |
... | |
deployer=`config_get user` | |
{ echo "cat <<EOFNOREALLY" | |
cat "$SCRIPTS/template.sh" | |
echo "EOFNOREALLY" | |
} | sh > "/tmp/templated.sh" | |
cat /tmp/templated.sh | |
... |