Skip to content

Instantly share code, notes, and snippets.

View fredoliveira's full-sized avatar

Fred Oliveira fredoliveira

View GitHub Profile
@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`
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 / 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.

@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 / 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 / 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 / redis
Created September 8, 2011 18:29
ubuntu init.d script for redis
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db
@fredoliveira
fredoliveira / week.rb
Created December 18, 2011 16:03
Script to calculate the current week for weekly notes
#!/usr/bin/ruby
require 'date'
registration_date = Date.civil(2006,1,13)
this_week = Date.today
# Get the start of the week for each of those dates
if registration_date.wday == 0
# wday of 0 is Sunday, and we want our weeks to start on Monday
@fredoliveira
fredoliveira / gist:1680217
Created January 26, 2012 01:06
Computer bootstrap
@fredoliveira
fredoliveira / .tmux.conf
Created March 27, 2012 04:05
Tmux config file
# new prefix
set -g prefix C-a
unbind C-b
# reload the config
bind r source-file ~/.tmux.conf \; display "Reloaded ~/.tmux.conf"
# set the shell
set -g default-command /bin/zsh
set -g default-shell /bin/zsh