Skip to content

Instantly share code, notes, and snippets.

View elmendalerenda's full-sized avatar

Miguel Ángel Fernández elmendalerenda

View GitHub Profile
@elmendalerenda
elmendalerenda / gist:9682905
Created March 21, 2014 09:50
misc settings
#.bashrc
alias ber='bundle exec rspec'
alias be='bundle exec'
export TERM=xterm-256color
@elmendalerenda
elmendalerenda / coin_change.rb
Created February 12, 2014 14:33
coin change
def coin_change(amount, denominations, partial_acc = [], acc = [])
denominations.each { |e|
acc.push(partial_acc.sort) if amount == 0
if amount - e >= 0
immutable_partial_acc = partial_acc.dup.push(e)
coin_change(amount - e, denominations, immutable_partial_acc, acc)
end
}
return acc.uniq
end
@elmendalerenda
elmendalerenda / links
Last active August 29, 2015 13:56
links
@elmendalerenda
elmendalerenda / gist:5691347
Created June 1, 2013 18:49
Search Dublin apartments in Luas green line
//do to http://www.daft.ie/lettings/ and run:
function selectOption(selector, optionsToSelect){
var items = document.querySelectorAll(selector + ' > option');
for (var item of items) {
for(var i = 0; i < optionsToSelect.length; i++){
if(item.text.match(optionsToSelect[i]) ){
item.selected = true;
console.log(item.text);
}
@elmendalerenda
elmendalerenda / install-modern-ie
Last active December 14, 2015 13:09
install modern ie in ubuntu
1. install virtualbox from oracle repo: https://www.virtualbox.org/wiki/Linux_Downloads (disable source repo)
2. install linux-headers-generic package
3. instal p7zip-full package
4. download image from http://www.modern.ie/en-us/virtualization-tools
5. 7z e <zipfile>
6. import image from virtualbox

Setup

git clone <repo>

clone the repository specified by ; this is similar to "checkout" in some other version control systems such as Subversion and CVS

Add colors to your ~/.gitconfig file:

@elmendalerenda
elmendalerenda / gist:4348427
Created December 20, 2012 20:48
run cucumber in a environment without gui
sudo apt-get install xvfb
sudo apt-get install firefox
xvfb-run cucumber
autoload -U compinit promptinit
compinit
promptinit
# This will set the default prompt to the walters theme
prompt walters
autoload -U compinit
compinit
@elmendalerenda
elmendalerenda / wordpress-vm-recipe.txt
Created November 22, 2012 10:09
wordpress vm installation
sudo lxc-create -t ubuntu -n wordpress
sudo lxc-start -n wordpress
#detailed instructions
http://ubuntuserverguide.com/2012/05/how-to-install-latest-wordpress-in-ubuntu-server-12-04-lts.html
#LAMP
sudo apt-get install lamp-server^
sudo apt-get install php5 php5-gd php5-mysql php5-curl php5-cli php5-cgi php5-dev
@elmendalerenda
elmendalerenda / backup.all.sh
Created November 11, 2012 10:51
backup proxmox vms
#!/bin/sh
RUTA_DUMPS="/var/lib/vz/dump/"
MAXIMO_COPIAS=5
for VZ_ID in `vzlist -1` ; do
VZ_HOSTNAME=`vzlist -o hostname -H ${VZ_ID}`
VZ_IP=`vzlist -o ip -H ${VZ_ID}`
VZ_DUMP="/var/lib/vz/dump/${VZ_HOSTNAME}_"`date '+%d%m%y%H%M%S'`".tgz"