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
| Various Cheats found on the Web | |
| mongo //Start Mongo | |
| show dbs //Show databases | |
| use mydb //User database named "mydb" | |
| db //Show selected database | |
| help //Get help | |
| show collection //Show collections from a database | |
| Finds - db.collection |
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
| http://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/ "So easy" | |
| 1. brew update | |
| 2. brew install mongodb | |
| 3. start > mongod | |
| 4. test > open shell > mongo | |
| db.test.save( { a: 1 } ) | |
| db.test.find() | |
| Recommend installing XCode Command line Tools |
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
| boilerplate | |
| HTML Boilerplate - simple HTML includes using jquery | |
| As a long time JSP developer, transitioning into the fabulous world of Pure HTML and JavaScript front-end development. There is a need to divide and conquer your web interface into manageable and reusable parts. This is a simple demo using JQuery that divides a front end website into three reusable parts. | |
| Header | |
| Main Container | |
| Navigation | |
| Footer | |
| There is not much to it. JQuery does all the magic. |
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
| if (window.addEventListener) { | |
| window.addEventListener("storage", storageEventHandler, true); | |
| } else if (window.attachEvent) { | |
| document.attachEvent("onstorage", storageEventHandler); | |
| } |
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
| RASPBIAN Wheezy | |
| RASPBIAN | |
| Debian Wheezy | |
| Version:January 2014 | |
| Release date:2014-01-07 | |
| Default login:pi / raspberry | |
| URL:raspbian.org | |
| Kernel version:3.10 | |
| http://www.raspberrypi.org/documentation/installation/installing-images/mac.md |
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
| Navigation Keys - These are used in command mode: | |
| $ Move to end of line | |
| ^ Move to beginning of line | |
| Save and Quit Commands - These are used in lastline mode: | |
| :w Write buffer (Save changes and continue working in vi Editor) | |
| :w new_filename Write buffer to new filename (continue working in vi) | |
| :wq Write buffer (save changes) and quit vi | |
| :q! Quit without saving changes | |
| :wq! Write buffer (save changes) and quit vi | |
| (The ! will override Read only permissions but only if you are the owner of the file.) |
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 util = require('util') | |
| function hook_stdout(callback) { | |
| var old_write = process.stdout.write | |
| process.stdout.write = (function(write) { | |
| return function(string, encoding, fd) { | |
| write.apply(process.stdout, arguments) | |
| callback(string, encoding, fd) | |
| } |
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
| //Time Complexity | |
| function solution(int x, int y, int d) | |
| { | |
| assert(x < y); // 1 | |
| assert(d > 0); | |
| int distance = y - x; // 2 | |
| int steps = distance / d; // 3 | |
| if(distance % d != 0) // 4 | |
| ++steps; |
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
| CLI elixir iex |
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
| // Forward to HTTP with Options | |
| // Stop using SSLV3 (no good) | |
| var options = | |
| { | |
| host: config.uri_velocity.host, | |
| port: config.uri_velocity.port, | |
| path: config.uri_velocity.path, | |
| method: 'POST', | |
| headers: { | |
| 'Content-Type': 'application/x-www-form-urlencoded', |
OlderNewer