Skip to content

Instantly share code, notes, and snippets.

View ngpestelos's full-sized avatar

Nestor G Pestelos Jr ngpestelos

View GitHub Profile
@ngpestelos
ngpestelos / ruby.sh
Created March 10, 2013 10:25
ruby-2.0.0-p0 postinstall script for veewee
#!/bin/sh
# Install ruby 2.0
cd /tmp
wget http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz
tar xvzf ruby-2.0.0-p0.tar.gz
cd ruby-2.0.0-p0
./configure --prefix=/opt/ruby CFLAGS="-O3 -funroll-loops -fomit-frame-pointer -pipe"
make
make install
@ngpestelos
ngpestelos / rbenv.sh
Created March 10, 2013 22:16
install rbenv (ruby 1.9.3-p385) on a basebox
#!/bin/sh
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.profile
echo 'eval "$(rbenv init -)"' >> ~/.profile
source ~/.profile
# Install ruby-build
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
@ngpestelos
ngpestelos / scala_import_classes.md
Last active December 15, 2015 15:09
Scala import classes

See: http://stackoverflow.com/questions/3075951/scala-importing-class

I have a file called CashFlow.scala that I wish to use with another object Hello.scala. Both are in the same directory:

class CashFlow(amt: Double, curr: String) {
  def this(amt: Double) = this(amt, "GBP")
  def doSomething {
    println "do something"
  }

}

@ngpestelos
ngpestelos / keikun17_vimrc_after
Created April 3, 2013 22:56
keikun17's vimrc.after
" Many stuff from http://www.drbunsen.org/text-triumvirate.html
" Visual mode unmap
" Bring back the functionality to press shift+e, shift+w, shift+b
" while in visual mode to go to the character right before the next
" whitespace
vunmap E
vunmap W
vunmap B
@ngpestelos
ngpestelos / keikun_vimrc
Created April 4, 2013 00:48
keikun's .vimrc
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
" TODO: this may not be in the correct place. It is intended to allow overriding <Leader>.
" source ~/.vimrc.before if it exists.
if filereadable(expand("~/.vimrc.before"))
source ~/.vimrc.before
endif
@ngpestelos
ngpestelos / keikun_tmux_conf
Created April 4, 2013 01:02
keikun tmux conf
# remap prefix to Control + a
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf
# quick pane cycling
@ngpestelos
ngpestelos / install_vbox_guest.sh
Created April 6, 2013 08:29
Install VirtualBox guest additions
#!/bin/sh
VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
sh /mnt/VBoxLinuxAdditions.run
umount /mnt
rm VBoxGuestAdditions_$VBOX_VERSION.iso
@ngpestelos
ngpestelos / gist:5325683
Last active December 15, 2015 21:29
Operation not permitted when running brew update using another Administrator account in OS X Lion
sudo chmod -R 775 /usr/local/Library/.
@ngpestelos
ngpestelos / gist:5329672
Created April 7, 2013 09:02
Get hitch to run on zsh
http://thechangelog.com/hitch-git-author-attribution-helper-for-pair-programmers/
$ hitch --setup >> ~/.zshrc
$ exec $SHELL -l
Test by hitching yourself and creating a sample git project. You should see a different email address ([email protected]).
@ngpestelos
ngpestelos / factorial_rec.rb
Created May 20, 2013 12:30
Recursive factorial in Ruby
def factorial(n)
if (n < 2)
n
else
n * factorial(n - 1)
end
end
puts factorial(0)
puts factorial(1)