Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Kleber Correia klebervirgilio

🎯
Focusing
View GitHub Profile
@klebervirgilio
klebervirgilio / install_postgis_osx.sh
Created Jul 31, 2011 — forked from juniorz/install_postgis_osx.sh
Installing PostGIS on Mac OS X and Ubuntu
View install_postgis_osx.sh
# Some good references are:
# http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x
# http://www.paolocorti.net/2008/01/30/installing-postgis-on-ubuntu/
# http://postgis.refractions.net/documentation/manual-1.5/ch02.html#id2630392
#1. Install PostgreSQL postgis and postgres
brew install postgis
initdb /usr/local/var/postgres
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
@klebervirgilio
klebervirgilio / install_postgis_osx.sh
Created Jul 31, 2011 — forked from juniorz/install_postgis_osx.sh
Installing PostGIS on Mac OS X and Ubuntu
View install_postgis_osx.sh
# Some good references are:
# http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x
# http://www.paolocorti.net/2008/01/30/installing-postgis-on-ubuntu/
# http://postgis.refractions.net/documentation/manual-1.5/ch02.html#id2630392
#1. Install PostgreSQL postgis and postgres
brew install postgis
initdb /usr/local/var/postgres
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
View gist:1596379
Current:
* Clean Code
* Crafting Rails Applications
Next:
* Domain-driven Design
* Design Patterns in Ruby
View gist:4420287
sudo ifconfig en1 ether `openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'`
View tmux_cheatsheet.markdown

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

View upgrading-vagrant-fusion.mdown

I had some headaches yesterday while trying to upgrade to VMWare Fusion with Vagrant.

The steps that work are:

  • export your boxes from Virtualbox to OVA files
  • run 'vagrant destroy' on all your boxes
  • uninstall Virtualbox using the uninstaller script in the installer DMG
  • download VMWare Fusion
  • run 'vagrant plugin install vagrant-vmware-fusion' to install the provider plugin
  • run 'vagrant plugin license vagrant-vmware-fusion license.lic' to install the license you just bought
View worm.rb
#!/usr/bin/env ruby
require 'gosu' # gem install gosu --no-document
include Gosu
$dimension, $splits = 200, 20
$size = $dimension.to_f / $splits.to_f
class Worm
attr_writer :dir
def initialize() reset end
@klebervirgilio
klebervirgilio / intergration_spec_helper.rb
Created Mar 13, 2016
Rspec: Drag and Drop file upload
View intergration_spec_helper.rb
module IntegrationSpecHelper
def drop_files files, drop_area_id
js_script = "fileList = Array();"
files.count.times do |i|
# Generate a fake input selector
page.execute_script("if ($('#seleniumUpload#{i}').length == 0) { seleniumUpload#{i} = window.$('<input/>').attr({id: 'seleniumUpload#{i}', type:'file'}).appendTo('body'); }")
# Attach file to the fake input selector through Capybara
attach_file("seleniumUpload#{i}", files[i])
# Build up the fake js event
js_script = "#{js_script} fileList.push(seleniumUpload#{i}.get(0).files[0]);"