$ rails g model User
belongs_to
has_one
/** | |
* A simple preforking echo server in C. | |
* | |
* Building: | |
* | |
* $ gcc -Wall -o echo echo.c | |
* | |
* Usage: | |
* | |
* $ ./echo |
#include <stdio.h> | |
#include <stdlib.h> | |
struct closure { | |
void (* call)(struct closure *); | |
int x; | |
}; |
<!doctype html> | |
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery-latest.min.js"></script> | |
<script src="client/socket.io.js" type="text/javascript" charset="utf-8"></script> | |
<script type="text/javascript" charset="utf-8"> | |
var socket = new io.Socket(null, {rememberTransport: false, port: 8080}); | |
socket.connect(); | |
socket.addEvent('message', function(data) { | |
$('body').append('<p>' + $.map(data, function(e,i) { |
var http = require("http"), | |
url = require("url"), | |
path = require("path"), | |
fs = require("fs") | |
port = process.argv[2] || 8888; | |
http.createServer(function(request, response) { | |
var uri = url.parse(request.url).pathname | |
, filename = path.join(process.cwd(), uri); |
//******************************************* | |
// Level 1, basic API, minimum support | |
//******************************************* | |
/* | |
Modules IDs are strings that follow CommonJS | |
module names. | |
*/ | |
//To load code at the top level JS file, | |
//or inside a module to dynamically fetch |
===Install Octopress=== | |
git clone git://github.com/imathis/octopress.git | |
cd octopress | |
gem install bundler rake --no-rdoc --no-ri | |
bundle install | |
rake install | |
===Start Blogging=== |
# First install tmux | |
brew install tmux | |
# For mouse support (for switching panes and windows) | |
# Only needed if you are using Terminal.app (iTerm has mouse support) | |
Install http://www.culater.net/software/SIMBL/SIMBL.php | |
Then install https://bitheap.org/mouseterm/ | |
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/ |
This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.
You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf
using homebrew.
As configured in my dotfiles.
start new:
tmux
start new with session name: