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
}
# 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/bash
#
# Download and install libevent and memcached from source on Debian Etch or
# Debian Lenny.
#
# Assumptions
# - libevent and memcached have not been installed from apt repositories
# - memcached is not already running
# - it is ok to clobber scripts at
# /etc/memcached.conf
# If your workers are inactive for a long period of time, they'll lose
# their MySQL connection.
#
# This hack ensures we re-connect whenever a connection is
# lost. Because, really. why not?
#
# Stick this in RAILS_ROOT/config/initializers/connection_fix.rb (or somewhere similar)
#
# From:
# http://coderrr.wordpress.com/2009/01/08/activerecord-threading-issues-and-resolutions/
require 'rubygems'
require 'sinatra'
require 'redis'
# To use, simply start your Redis server and boot this
# example app with:
# ruby example_note_keeping_app.rb
#
# Point your browser to http://localhost:4567 and enjoy!
#