Skip to content

Instantly share code, notes, and snippets.

View Goles's full-sized avatar

Nicolas Goles Goles

View GitHub Profile
@Goles
Goles / tmux.conf
Created March 31, 2013 19:24
My tmux conf
###
### Nicolas Goles tmux config file.
###
set-option -g default-command "reattach-to-user-namespace -l zsh"
set -g default-terminal "screen-256color"
set -g history-limit 20000
set-option -ga update-environment ' LANG'
set-option -ga update-environment ' LC_ALL'
// In my Core Data Model a Category has a one to many relation with CategoryMembers
- (void) loadCoreDataFromJSONArray:(NSArray *) jsonArray
{
[jsonArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
// Create our category
Category *category = [NSEntityDescription insertNewObjectForEntityForName:@"Category" inManagedObjectContext:self.managedObjectContext];
category.name = [obj objectForKey:@"name"];
// Traverse the category members
NSArray *membersArray = [obj objectForKey:@"members"];
@Goles
Goles / CountryCodes.json
Created July 29, 2012 05:37
Country and Dial or Phone codes in JSON format
[{"name":"Israel","dial_code":"+972","code":"IL"},{"name":"Afghanistan","dial_code":"+93","code":"AF"},{"name":"Albania","dial_code":"+355","code":"AL"},{"name":"Algeria","dial_code":"+213","code":"DZ"},{"name":"AmericanSamoa","dial_code":"+1 684","code":"AS"},{"name":"Andorra","dial_code":"+376","code":"AD"},{"name":"Angola","dial_code":"+244","code":"AO"},{"name":"Anguilla","dial_code":"+1 264","code":"AI"},{"name":"Antigua and Barbuda","dial_code":"+1268","code":"AG"},{"name":"Argentina","dial_code":"+54","code":"AR"},{"name":"Armenia","dial_code":"+374","code":"AM"},{"name":"Aruba","dial_code":"+297","code":"AW"},{"name":"Australia","dial_code":"+61","code":"AU"},{"name":"Austria","dial_code":"+43","code":"AT"},{"name":"Azerbaijan","dial_code":"+994","code":"AZ"},{"name":"Bahamas","dial_code":"+1 242","code":"BS"},{"name":"Bahrain","dial_code":"+973","code":"BH"},{"name":"Bangladesh","dial_code":"+880","code":"BD"},{"name":"Barbados","dial_code":"+1 246","code":"BB"},{"name":"Belarus","dial_code":"+375","
@Goles
Goles / eastwood-custom.sh
Created July 6, 2012 23:51
Zsh eastwood theme with basic git commit timer :)
# RVM settings
# if [[ -s ~/.rvm/scripts/rvm ]] ; then
# RPS1="%{$fg[yellow]%}rvm:%{$reset_color%}%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt)%{$reset_color%} $EPS1"
# else
# if which rbenv &> /dev/null; then
# RPS1="%{$fg[yellow]%}rbenv:%{$reset_color%}%{$fg[red]%}\$(rbenv version | sed -e 's/ (set.*$//')%{$reset_color%} $EPS1"
# fi
# fi
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}["
@Goles
Goles / vim.rb
Created May 4, 2012 19:23
Vim formula for brew for Snow Leopard with osx-gcc-installer
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
url 'https://vim.googlecode.com/hg/', :revision => 'f1f6ac67acd8'
version '7.3.462'
def features; %w(tiny small normal big huge) end
def interp; %w(lua mzscheme perl python python3 tcl ruby) end
@Goles
Goles / vim.rb
Created April 28, 2012 01:04 — forked from mgrouchy/vim.rb
Vim formula for Homebrew < AD Default
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
url 'https://vim.googlecode.com/hg/', :revision => 'f1f6ac67acd8'
version '7.3.462'
def features; %w(tiny small normal big huge) end
def interp; %w(lua mzscheme perl python python3 tcl ruby) end
@Goles
Goles / vim.rb
Created April 28, 2012 00:02 — forked from smartinez87/vim.rb
Vim formula for Homebrew
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
url 'ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2'
head 'https://vim.googlecode.com/hg/'
sha256 '5c5d5d6e07f1bbc49b6fe3906ff8a7e39b049928b68195b38e3e3d347100221d'
version '7.3.487'
def features; %w(tiny small normal big huge) end
$ tmux list-windows
0: tmux [208x73] [layout b147,208x73,0,0[208x62,0,0,208x10,0,63{104x10,0,63,103x10,105,63}]] (active)
@Goles
Goles / cliclock.sh
Created April 5, 2012 20:37
Small command line world clock taken from Stack Overflow ( http://stackoverflow.com/questions/370075/command-line-world-clock )
#!/bin/sh
# Command-line world clock
# Taken from http://stackoverflow.com/questions/370075/command-line-world-clock
# .worldclock.zones file looks like:
# US/Pacific
# Europe/Berlin
# Chile/Continental
: ${WORLDCLOCK_ZONES:=$HOME/.worldclock.zones}
@Goles
Goles / zsh_git_timer.sh
Created March 7, 2012 04:06
ZSH Snippets to add time since last commit, got this somewhere... forgot where :)
# Add this to your .oh-my-zsh theme if you're using those, or directly to your zsh theme :)
# Colors vary depending on time lapsed.
ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}"
ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg[yellow]%}"
ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}"
ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[cyan]%}"
#Customized git status, oh-my-zsh currently does not allow render dirty status before branch
git_custom_status() {