Skip to content

Instantly share code, notes, and snippets.

View colindensem's full-sized avatar
🏠
Working from home

Fynn.Codes colindensem

🏠
Working from home
View GitHub Profile
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/opt/subversion/bin/:$PATH"
# command prompt
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
function proml {
local BLUE="\[\033[0;36m\]"
local RED="\[\033[0;31m\]"
local LIGHT_RED="\[\033[1;31m\]"
# Runs `git push` before `cap deploy`
# Otherwise just passes through to `cap`
function cap {
CAP="`which cap`"
if [[ "$1" == "deploy" || "$2" == "deploy" ]]; then
git push && $CAP $*
else
$CAP $*
fi
}
rescue ActiveRecord::StatementInvalid => e
puts "*"*10
puts "Error message: #{e}"
puts "*"*10
# Application
class App < Sinatra::Base
set :hi, "Hello"
configure :test do
set :hi, "Hello There!"
end
end
# Registering a extention
Rails CMS alternatives
======================
Active projects:
---------------
adva-cms
repo: http://github.com/svenfuchs/adva_cms/
site: http://adva-cms.org/
Last update: 11/24/09
"the cutting edge Rails CMS platform"
# mongo_template.rb
# fork of Ben Scofield's Rails MongoMapper Template (http://gist.github.com/181842)
#
# To use:
# rails project_name -m http://gist.github.com/gists/285125.txt
# remove unneeded defaults
run "rm public/index.html"
run "rm public/images/rails.png"
run "rm public/javascripts/controls.js"
development: &global_settings
database: textual_development
host: 127.0.0.1
port: 27017
test:
database: textual_test
<<: *global_settings
production:

Installing MongoDB on Debian (Ubuntu 9.10 Karmic Koala) – From Scratch!

$ sudo apt-get -y install tcsh git-core scons g++
$ sudo apt-get -y install libpcre++-dev libboost-dev libreadline-dev xulrunner-1.9.1-dev
$ curl -O ftp://ftp.mozilla.org/pub/mozilla.org/js/js-1.7.0.tar.gz
$ tar zxvf js-1.7.0.tar.gz
$ cd js/src
$ export CFLAGS=“-DJS_C_STRINGS_ARE_UTF8”
$ sudo make -f Makefile.ref
$ sudo JS_DIST=/usr make -f Makefile.ref export

#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /usr/local/nginx/logs/nginx.pid;
events {
worker_connections 1024;
}