Skip to content

Instantly share code, notes, and snippets.

View karbassi's full-sized avatar
🌱

Ali Karbassi karbassi

🌱
View GitHub Profile
/*
example usage in subclassed form:
$this->addTableGroup(array(
// row 1
array(
$this->createElement('text', 'name1', array('label' => 'test1')),
$this->createElement('text', 'name2', array('label' => 'test1')),
),
// row 2
@karbassi
karbassi / primes.rb
Created September 11, 2008 04:27
Ruby class to return primes.
class Primes
attr_reader :primes
def initialize(len = nil)
return nil if len.nil?
state = Numeric.new
@primes = [2, 3]
i = 4
class PerfectNumbers
attr_reader :perfects
def initialize(len = nil)
return nil if len.nil?
# sequence A000043 in OEIS
# http://www.research.att.com/~njas/sequences/A000043
n = [2, 3, 5, 7, 13, 17, 19, 31, 61, 89, 107, 127, 521, 607, 1279, 2203,
2281, 3217, 4253, 4423, 9689, 9941, 11213, 19937, 21701, 23209, 44497,
86243, 110503, 132049, 216091, 756839, 859433, 1257787, 1398269,
@karbassi
karbassi / .vimrc
Created October 12, 2008 18:18 — forked from fc/gist:16331
if has('win32')
set backupdir=C:/cygwin_updated/var/vim/backup
set directory=C:/cygwin_updated/var/vim/tmp
elseif has('win32unix')
if exists("*mkdir")
if !isdirectory('/var/vim/')
mkdir('/var/vim/')
endif
if !isdirectory('/var/vim/backup/')
mkdir('/var/vim/backup/')
(ANDY)
Lock eyes from across the room
down my drink while the rhythms boom
take your hand and skip the names
no need here for the silly games
make our way through the smoke and crowd
the club is the sky and I’m on your cloud
move in close as the lasers fly
our bodies touch and the angels cry
CMP (COLUMBIA) - Okay. Thank you. Glad to hear the system's looking good. You have a suggested attitude for me? This one here seems all right.
CC - Stand by.
CMP (COLUMBIA) - Let me know when it's lunch time, will you?
CC - Say again.
CMP (COLUMBIA) - Oh, disregard.
@karbassi
karbassi / Essential OSX Apps
Created July 22, 2009 22:42
Must have apps
1Password
Adium
Adobe Photoshop
AppFresh
AudialHub
Awaken
BetterZip
Boxee
Burn
Caffeine
# Rename an email address in all old commits.
# WARNING: Will change all your commit SHA1s.
# Based off of the script from here:
# http://coffee.geek.nz/how-change-author-git.html
git filter-branch -f --commit-filter '
if [ "$GIT_COMMITTER_EMAIL" = "joern.zaefferer@googlemail.com" ];
then
GIT_AUTHOR_EMAIL="joern.zaefferer@gmail.com";
GIT_COMMITTER_EMAIL="joern.zaefferer@gmail.com";
git commit-tree "$@";
(2:37:08 PM) Rick: i'm going to complain for a moment
(2:37:19 PM) Rick: i'm working with another developer
(2:37:33 PM) Rick: on a project i started and my client brought him in to help
(2:37:49 PM) Rick: i told him that we're using jquery
(2:38:08 PM) Rick: the admin screen css and the user css are separate
(2:38:18 PM) Rick: and what does he do
(2:38:31 PM) Rick: uses prototype/script..
(2:38:38 PM) Rick: and does inline css
(2:38:48 PM) Harold: damn
(2:38:54 PM) Rick: now there's a conflict and retarded load times
@karbassi
karbassi / macports.sh
Created November 11, 2009 20:02
Install macports on mac.
# Move to tmp directory
cd $TMPDIR
# Download version 1.8.1 of MacPorts
curl -OL http://distfiles.macports.org/MacPorts/MacPorts-1.8.1.tar.gz
# Untar it
tar xzvf MacPorts-1.8.1.tar.gz
# Open it