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
| /* MongoDB cheat sheet */ | |
| // replication lag via serverStatus() | |
| db._adminCommand( { serverStatus : 1 , repl ; 2 } ) | |
| // stats | |
| db.stats() | |
| db.foo.stats() | |
| // size of BSON of some query |
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
| # Ubuntu upstart file at /etc/init/mongodb.conf | |
| pre-start script | |
| mkdir -p /var/lib/mongodb/ | |
| mkdir -p /var/log/mongodb/ | |
| end script | |
| start on runlevel [2345] | |
| stop on runlevel [06] |
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
| // checksum calculation for GTIN-8, GTIN-12, GTIN-13, GTIN-14, and SSCC | |
| // based on http://www.gs1.org/barcodes/support/check_digit_calculator | |
| function isValidBarcode(barcode) { | |
| // check length | |
| if (barcode.length < 8 || barcode.length > 18 || | |
| (barcode.length != 8 && barcode.length != 12 && | |
| barcode.length != 13 && barcode.length != 14 && | |
| barcode.length != 18)) { | |
| return false; | |
| } |
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
| /* 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'); |
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
Show hidden characters
| // Place user-specific overrides in this file, to ensure they're preserved | |
| // when upgrading | |
| { | |
| "folder_exclude_patterns": [".svn", ".git", ".hg", "CVS", "node_modules"] | |
| } |
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
| # Cakefile to document, compile, join and minify CoffeeScript files for | |
| # client side apps. Just edit the config object literal. | |
| # | |
| # -jrmoran | |
| fs = require 'fs' | |
| {exec, spawn} = require 'child_process' | |
| # order of files in `inFiles` is important | |
| config = |
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
| // {{compare unicorns ponies operator="<"}} | |
| // I knew it, unicorns are just low-quality ponies! | |
| // {{/compare}} | |
| // | |
| // (defaults to == if operator omitted) | |
| // | |
| // {{equal unicorns ponies }} | |
| // That's amazing, unicorns are actually undercover ponies | |
| // {{/equal}} | |
| // (from http://doginthehat.com.au/2012/02/comparison-block-helper-for-handlebars-templates/) |
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
| MongoDB upstart scripts for Ubuntu. | |
| Run following commands after installing upstart scripts: | |
| ln -s /lib/init/upstart-job /etc/init.d/mongoconf | |
| ln -s /lib/init/upstart-job /etc/init.d/mongodb | |
| ln -s /lib/init/upstart-job /etc/init.d/mongos | |
| To start services use: |
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
| nodejs-deps: | |
| pkg.installed: | |
| - names: | |
| - g++ | |
| - curl | |
| - libssl-dev | |
| - apache2-utils | |
| require: | |
| - pkg: git |
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
| <ifModule mod_rewrite.c> | |
| Options +FollowSymLinks | |
| IndexIgnore */* | |
| RewriteEngine On | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteCond %{REQUEST_FILENAME} !-d | |
| RewriteRule (.*) index.html | |
| </ifModule> |
OlderNewer