Skip to content

Instantly share code, notes, and snippets.

# Install required gems
gem "ember-rails", "~> 0.15"
run "bundle install"
# Configure the app to serve Ember.js and app assets from an AssetsController
generate :controller, "Assets", "index"
run "rm app/views/assets/index.html.erb"
file 'app/views/assets/index.html.erb', <<-CODE
<!DOCTYPE html>
@lb
lb / get_latest_chromium.sh
Created December 22, 2011 10:17 — forked from jehiah/get_latest_chromium.sh
script to download the latest chromium build nightly
#!/bin/sh
## this is a quick and dirty script to automagically install the latest chromium build on OSX 10.5
## you can set this up as a nightly cron job, or run manually from the command line
# USAGE:
# save script to your home directory aka /Users/$USER/
# open up a command prompt (aka /Applications/Utilities/Terminal)
# run manually from the command line whenever you want the most recent chromium build
# $ sh get_latest_chromium.sh
# start it as a nightly task (runs at 1am or edit the plist below)
@lb
lb / update_textmate.sh
Created April 4, 2011 13:12
Update TextMate Bundles straight from SVN
#!/usr/bin/env bash
mkdir -p /Library/Application\ Support/TextMate/
sudo chown -R $(whoami) /Library/Application\ Support/TextMate
cd /Library/Application\ Support/TextMate/
if [[ -d Bundles/.svn ]] ; then
cd Bundles && svn up
@lb
lb / objwebapp.rb
Created November 16, 2010 21:24
Exposing any Ruby object as a web app
require 'rubygems'
require 'rack'
class Object
def webapp
class << self
define_method :call do |env|
func, *attrs = env['PATH_INFO'].split('/').reject(&:empty?)
[200, {}, send(func, *attrs)]
end
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
~> read the result on the screen and do what asked
rvm install 1.9.2
~> call a friend while rvm is downloading and installing yo rubee
rvm use 1.9.2
  • Install The Glorious Glasgow Haskell Compilation System from this link: http://hackage.haskell.org/platform/. Install both the language and the platform.
  • Open your terminal and issue the following commands: ghc --version and cabal --version to check everything is working correctly

Now you have full not working version of Haskell; even a trivial code will not complile.

  • Edit /usr/bin/ghc
  • append -optc-m32 -opta-m32 -optl-m32 to the line beginning with exec
  • Save & Exit
mean = rep(1/N, N) %*% r
loop(Users, N) ->
receive
{connect, Pid, User, Password} ->
io:format("connection request from:~p ~p ~p~n",
[Pid, User, Password]),
case member({User, Password}, Users) of
true ->
Max = max_connections(),
if
N > Max ->