Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
Ctrl+C | copy current line (if no selection) |
Ctrl+X | cut current line (if no selection) |
Ctrl+⇧+K | delete line |
Ctrl+↩ | insert line after |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
description "Upstart script to run a nodejs app as a service" | |
author "Louis Chatriot" | |
env NODE_BIN=/usr/local/bin/node | |
env APP_DIR=/path/to/app/dir | |
env SCRIPT_FILE="scriptfile.js" # Entry point for the nodejs app | |
env LOG_FILE=/path/to/logfile.log | |
env RUN_AS="anyuser" # Upstart can only be run nicely as root, need to drop privileges | |
env SERVER_ENV="anything" # Usual apps can be run in different environments (development, test, production ...) | |
# I typically use the environment variable NODE_ENV (see below) |
# 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] |
Public void CalculatePrivateRoom(){ | |
type = "Private"; | |
cost = privateRoom; | |
medication *= 2; | |
cost *= noOfDays; | |
medication *= noOfDays; | |
telephone *= noOfDays; | |
television *= noOfDays; | |
total = television + telephone + medication + cost; | |
} |
Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
Ctrl+C | copy current line (if no selection) |
Ctrl+X | cut current line (if no selection) |
Ctrl+⇧+K | delete line |
Ctrl+↩ | insert line after |
# Install with: | |
# bash < <(curl -L https://raw.github.com/gist/2771479) | |
# | |
# Reference: http://blog.wyeworks.com/2011/11/1/ruby-1-9-3-and-ruby-debug | |
echo "Installing ruby-debug with ruby-1.9.3-p0 ..." | |
curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem | |
curl -OL http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem |
// A last.fm nowplaying plugin. | |
// Author: thevdude ([email protected]) | |
// | |
// Uses installed node modules mongoose, lastfm, inflection, and bitly. | |
// | |
// Current functions include: | |
// Display user's currently or last played track (np) | |
// Compare lastfm users with the tasteometer (cp) | |
// Get a users lastfm url (url) | |
// Find a user's top ten artists for different time periods (topten) |
#include <iostream> | |
#include <ctime> | |
#include <ctype.h> | |
using namespace std; | |
const int wordSIZE = 50; | |
void checkVowel(char word[], int size, bool &first_VOWEL, bool &first_CAP, bool &VOWEL ); | |
int arrayLength(char[]); |