Skip to content

Instantly share code, notes, and snippets.

View fredoliveira's full-sized avatar

Fred Oliveira fredoliveira

View GitHub Profile
@fredoliveira
fredoliveira / fred.zsh-theme
Created August 23, 2011 16:06
My current zsh theme
PROMPT='%{$fg_bold[blue]%}$(git_prompt_info)%{$fg[green]%}%c %{$fg_bold[red]%}> %{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
@fredoliveira
fredoliveira / boot.sh
Created August 6, 2011 22:45
Bootstrap script
#!/bin/sh
if [ -z "$1" ]; then
echo usage: $0 directory
exit
fi
OUTPUTDIR=$1
# clone our main tree
@fredoliveira
fredoliveira / kevinkellyweb20expo.md
Created April 2, 2011 16:58
Notes from Kevin Kelly's presentation at Web 2.0 Expo San Francisco 2011

Kevin Kelly @ Web 2.0

Here are my notes from Kevin Kelly's presentation at Web 2.0 Expo San Francisco, 2011. In this talk, Kevin explores 5 main verbs that will shape our future. These verbs are screening, interacting, sharing, flowing and generating. Thought provoking stuff - also worthy of a good read is his book "What Technology Wants".

Screening

  • Screens for everything
  • Everything will be a screen
  • Screens will be everywhere
@fredoliveira
fredoliveira / SCVNGR.md
Created April 2, 2011 15:52
Game mechanics deck from SCVNGR. More info: http://tcrn.ch/hD830P

1. Achievement

Definition: A virtual or physical representation of having accomplished something. These are often viewed as rewards in and of themselves.

Example: a badge, a level, a reward, points, really anything defined as a reward can be a reward.

2. Appointment Dynamic

Definition: A dynamic in which to succeed, one must return at a predefined time to take some action. Appointment dynamics are often deeply related to interval based reward schedules or avoidance dyanmics.

PROMPT='%{$fg_bold[cyan]%}☁ %{$fg_bold[green]%}%p %{$fg[green]%}%c %{$fg_bold[cyan]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[%{$fg[cyan]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}] %{$fg[yellow]%}⚡%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}]"
RPROMPT='%{$fg_bold[green]%}[%*]%{$reset_color%}'
@fredoliveira
fredoliveira / .zshrc
Created March 22, 2011 03:19
Oh-my-zsh config
export ZSH=$HOME/.oh-my-zsh
export ZSH_THEME="cloud"
# export CASE_SENSITIVE="true"
# export DISABLE_AUTO_UPDATE="true"
# export DISABLE_LS_COLORS="true"
plugins=(git)
source $ZSH/oh-my-zsh.sh
export EC2_HOME=~/.ec2
export EC2_PRIVATE_KEY=`ls $EC2_HOME/pk-*.pem`
@fredoliveira
fredoliveira / updatemunin.rb
Created March 10, 2011 14:26
A script (should be added to cron) to dynamically update munin hosts
require 'rubygems'
require 'AWS'
ACCESS_KEY_ID = ""
SECRET_KEY = ""
NODEGROUP = ""
@ec2 = AWS::EC2::Base.new(:secret_access_key => SECRET_KEY, :access_key_id => ACCESS_KEY_ID)
output = ""
@fredoliveira
fredoliveira / bootstrap.sh
Created February 27, 2011 15:43
Ubuntu 10.04 LTS Bootstrap script
# system, ruby, apache
apt-get update
apt-get upgrade
apt-get install ruby ruby-dev libopenssl-ruby rdoc ri irb build-essential wget ssl-cert apache2 libcurl4-openssl-dev libssl-dev zlib1g-dev apache2-prefork-dev libapr1-dev libaprutil1-dev git-core libxml2-dev libxslt-dev mysql-server
# rubygems
cd /tmp
wget http://production.cf.rubygems.org/rubygems/rubygems-1.5.3.tgz
tar zxf rubygems-1.5.3.tgz
cd rubygems-1.5.3
@fredoliveira
fredoliveira / ffffound.rb
Created February 12, 2011 17:28
The script I use to backup my ffffound items. Far from perfect, and the system call is quite a hack, but I was in a hurry and this does it for me.
require 'rubygems'
require 'nokogiri'
require 'open-uri'
pages = 78
username = "fred"
def grab_url(offset)
Nokogiri::HTML(open("http://ffffound.com/home/#{username}/found/?offset=#{offset}"))
end
@fredoliveira
fredoliveira / gist:791809
Created January 23, 2011 04:14
macvim personalizations
color molokai2
set guioptions=aAce
set columns=120
set guifont=Inconsolata:h12
set wrap
" screw those standards, i like my tabs being just that. tabs.
set tabstop=4
set shiftwidth=4
set softtabstop=4