Skip to content

Instantly share code, notes, and snippets.

@cnix
cnix / build.sh
Created July 27, 2008 10:56
Build lighty and php for leopard
#Build lighty and php for leopard
curl -O ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-6.6.tar.gz
tar xzvf pcre-6.6.tar.gz
cd pcre-6.6
./configure --prefix=/usr/local CFLAGS=-O1
make
sudo make install
curl -O http://lighttpd.net/download/lighttpd-1.4.11.tar.gz
server.port = 3000
# server.errorlog = CWD + "/log/lighttpd.error.log"
# accesslog.filename = CWD + "/log/lighttpd.access.log"
server.modules = ( "mod_rewrite",
"mod_access",
"mod_fastcgi",
"mod_userdir",
"mod_accesslog" )
function sticky_clicky(list) {
var lis = list.getElementsByTagName('li');
var i = 0;
do
{
lis[i].style.cursor='pointer';
lis[i].addEventListener('click', color_me, false);
i++;
var last = false;
var color_me = function() {
var phone_inputs = $('.phone_input').length ? $('.phone_input') : null;
if (phone_inputs) {
phone_inputs.bind('keyup', function() {
self = $(this);
if (self.val().length == self.attr('maxlength')) {
self.next().focus();
};
})
};
$('.btn').each(function(){
var b = $(this);
var tt = b.html() || b.val();
if ($(':submit,:button',this)) {
b = $('<a>').insertAfter(this). addClass(this.className).attr('id',this.id);
$(this).remove();
}
b.text('').css({cursor:'pointer'}). prepend('<i></i>').append($('<span>'). html(tt).append('<i></i><span></span>'));
%h1 Git Local
- if @config != {}
%p= "Your repository is located at #{@config['path']}"
- end
- if @config == {}
%form{:action => '/create_repo_path', :method => 'post'}
%h2 Set Up Your Server
%p
%label{:for => 'path'} Create a path for your repository:
body {
font-family: Helvetica,arial,sans-serif;
}
#entryPrint table {
width: 500px;
border: collapse;
border: 1px solid;
}
#entryPrint tr {
class PostsController < ApplicationController
def create
@post = Post.new(params[:post])
if @post.save
tweet(@post)
flash[:notice] = 'Post was successfully created.'
redirect_to manage_posts_path
else
render :action => 'new'
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
function proml {
local BLUE="\[\033[0;34m\]"
local RED="\[\033[0;31m\]"
local LIGHT_RED="\[\033[1;31m\]"
local GREEN="\[\033[0;32m\]"
local LIGHT_GREEN="\[\033[1;32m\]"
sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config