-
This is a numbered list.
-
I'm going to include a fenced code block as part of this bullet:
Code More Code
| server { | |
| root /var/www/example.com/static; | |
| server_name example.com; | |
| access_log /var/log/nginx/example.com.access.log; | |
| error_log /var/log/nginx/example.com.error.log; | |
| try_files /maintenance.html @proxy; | |
| location @proxy { | |
| proxy_pass http://127.0.0.1:10001; |
| /* The API controller | |
| Exports 3 methods: | |
| * post - Creates a new thread | |
| * list - Returns a list of threads | |
| * show - Displays a thread and its posts | |
| */ | |
| var Thread = require('../models/thread.js'); | |
| var Post = require('../models/post.js'); |
| import objc | |
| import AddressBook as ab | |
| import pprint as pp | |
| def pythonize(objc_obj): | |
| if isinstance(objc_obj, objc.pyobjc_unicode): | |
| return unicode(objc_obj) | |
| elif isinstance(objc_obj, ab.NSDate): | |
| return objc_obj.description() |
Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.
open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl
You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html
Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.
open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl
You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html
| var application_root = __dirname, | |
| express = require("express"), | |
| path = require("path"), | |
| mongoose = require('mongoose'); | |
| var app = express.createServer(); | |
| // database | |
| mongoose.connect('mongodb://localhost/ecomm_database'); |
This gist assumes:
- you have a local git repo
- with an online remote repository (github / bitbucket etc)
- and a cloud server (Rackspace cloud / Amazon EC2 etc)
- your (PHP) scripts are served from /var/www/html/
- your webpages are executed by apache
- apache's home directory is /var/www/
| This playbook has been removed as it is now very outdated. |
| /* | |
| I cannot claim this - it was recommended by a friend as a 'good enough' unique id generator | |
| for local client side scenarios in the browser. The use case I'm looking to address has to | |
| do with cross-frame messaging, where each point of origin needs a unique id (to be used as an | |
| "origin" or correlation identifier). Therefore - the IDs do not need to be unique on a large | |
| scale (e.g. - across a vast network of connected clients), but only in the browser, locally, | |
| for the life of the session. Question is: is this good enough? | |
| */ | |
| function createUUID() { | |
| var s = []; |