#Ubuntu Server Setup
##Create Server
- DigitalOcean or other cloud service
- Setup DNS A record
##User Setup
As root:
var safeCharsForCSSContent = /[0-9A-Za-z\`\~\!\@\#\$\%\^\&\*\(\)\-\_\=\+\|\[\{\]\}\:\,<\.\>\/\?]/; | |
var singleEscapeChars = /[\\\;]/; | |
function escapeForCSSContent(text) { | |
var index = 0, | |
length = text ? text.length : 0, | |
result = ''; | |
while(index < length) { | |
var character = text.charAt(index); | |
if (safeCharsForCSSContent.test(character)) { |
/* | |
* Dump binding values onto the page using this HTML syntax: | |
* <div data-bind="dump: $data"></div> | |
*/ | |
/* catch and precent cyclical references in rootObject */ | |
function toJSON(rootObject, replacer, spacer) { | |
var cache = []; | |
var plainJavaScriptObject = ko.toJS(rootObject); |
Windows Registry Editor Version 5.00 | |
; This will make it appear when you right click ON a folder | |
; The "Icon" line can be removed if you don't want the icon to appear | |
[HKEY_CLASSES_ROOT\Directory\shell\sublime] | |
@="Open Folder as &Sublime Project" | |
"Icon"="\"C:\\Program Files\\Sublime Text 2\\sublime_text.exe\",0" | |
[HKEY_CLASSES_ROOT\Directory\shell\sublime\command] |
// Only add setZeroTimeout to the window object, and hide everything | |
// else in a closure. | |
(function() { | |
var timeouts = []; | |
var messageName = "zero-timeout-message"; | |
// Like setTimeout, but only takes a function argument. There's | |
// no time argument (always zero) and no arguments (you have to | |
// use a closure). | |
function setZeroTimeout(fn) { |
public static void TestTypeSwitch() | |
{ | |
var ts = new TypeSwitch() | |
.Case((int x) => Console.WriteLine("int")) | |
.Case((bool x) => Console.WriteLine("bool")) | |
.Case((string x) => Console.WriteLine("string")); | |
ts.Switch(42); | |
ts.Switch(false); | |
ts.Switch("hello"); |
public enum EngineType | |
{ | |
Diesel, | |
Gasoline | |
} | |
public class Bicycle | |
{ | |
public int Cylinders; | |
} |
#Ubuntu Server Setup
##Create Server
##User Setup
As root:
I haven't set up an install guide for the latest ubuntu release, largely because the last set of instructions worked pretty closely with the latest and greatest Ubuntu, 12.04 Precise Pangolin, however when installing today, I found that there were enough differences in the way that I configure my setup to justify an update, so here it goes. Yes, I'm late to the party, but a quick google search didn't find anything that I felt was as complete for my requirements as my previous install guides, so here I go.
As always with my install guides, I have included here is just about everything you'll need (and then some) to get started with ruby on rails development with Ubuntu 12.04 as a platform. These are my settings and preferences, and this is certainly not the only way of doing things, so keep that in mind.
##Step 0: User Setup (from root login)
sudo adduser <username>
sudo adduser sudo