Skip to content

Instantly share code, notes, and snippets.

View wbotelhos's full-sized avatar
💭
I'm not my code.

Washington Botelho wbotelhos

💭
I'm not my code.
View GitHub Profile
@wbotelhos
wbotelhos / gist:2186130
Created March 24, 2012 18:32
Avoid Text Selection
// JS
window.getSelection().removeAllRanges();
// CSS
element {
-khtml-user-select: none;
-moz-user-select: none;
-o-user-select: none;
-webkit-user-select: none;
@wbotelhos
wbotelhos / gist:2634405
Created May 8, 2012 11:41
Install gcc in Ubuntu
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential
gcc --version
@wbotelhos
wbotelhos / gist:2634436
Created May 8, 2012 11:52
Install Python environment in Unbuntu
sudo apt-get install python-setuptools
sudo apt-get install python-pip
pip install PIL
python -V
#python -c 'import sys; print sys.version'
@wbotelhos
wbotelhos / gist:2648191
Created May 9, 2012 19:26
Python environment project (Ubuntu)
# Project
sudo pip install mockito
sudo pip install nose
wget http://archive.ubuntu.com/ubuntu/pool/main/t/twisted/python-twisted-bin_11.0.0-2_i386.deb
sudo dpkg -i python-twisted-bin_11.0.0-2_i386.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/p/python-pika/python-pika_0.9.5-1_all.deb
sudo dpkg -i python-pika_0.9.5-1_all.deb
@wbotelhos
wbotelhos / gist:2858681
Created June 2, 2012 14:41
Pip and Virtualenv on Unix
curl -O http://python-distribute.org/distribute_setup.py
sudo python distribute_setup.py
sudo easy_install pip
sudo pip install virtualenv
@wbotelhos
wbotelhos / gist:2859958
Created June 2, 2012 21:07
Creating a Django project on Mac
cd workspace
# distribute and pip / uncompressed packages
virtualenv --distribute --unzip-setuptools my_app
cd my_app
# activate an isolated environment to the project (my_app)
source bin/activate
@wbotelhos
wbotelhos / gist:2892451
Created June 7, 2012 23:45
Uninstall MySQL
# Linux
sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
# Linux
locate mysql
# Mac, Linux
find / -name mysql -print 2> /dev/null
@wbotelhos
wbotelhos / gist:2955683
Created June 19, 2012 18:13
Fix zlib load on Rails Install (Ubuntu)
gem install rails
# ERROR: Loading command: install (LoadError)
# cannot load such file -- zlib
# ERROR: While executing gem ... (NameError)
# uninitialized constant Gem::Commands::InstallCommand
sudo apt-get install zlib1g-dev
rvm reinstall 1.9.3
rvm use 1.9.3
@wbotelhos
wbotelhos / EntityWrapper.java
Created July 12, 2012 14:26
VRaptor and jQuery Gridy
public class EntityWrapper<T> {
private Collection<T> list;
private Integer total;
public Collection<T> getList() {
return list;
}
public void setList(Collection<T> list) {
@wbotelhos
wbotelhos / gist:3132996
Created July 17, 2012 23:50
Updating to Bundler pre-release
rvm gemset use global
gem update rubygems-bundler
gem list
gem uninstall -ax bundler
gem install bundler --pre
bundle --version