Skip to content

Instantly share code, notes, and snippets.

View alexmarles's full-sized avatar
🙃

Àlex Marlés alexmarles

🙃
View GitHub Profile
#!/bin/bash
# Install Brew
echo "Installing Homebrew for package managing"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install git
echo "Installing last git from brew"
brew install git
@alexmarles
alexmarles / pre-push
Last active August 29, 2015 14:16
Prevent git push --force for master branch (by @ErisDS from http://dev.ghost.org/prevent-master-push/)
#!/bin/bash
# Prevents force-pushing to master.
protected_branch='master'
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
push_command=`ps -ocommand= -p $PPID`
if [[ $protected_branch = $current_branch && $push_command =~ force|delete|-f ]]
then
read -p "You're about to push master, is that what you intended? [y|n] " -n 1 -r < /dev/tty
import java.util.*;
import java.io.*;
import java.security.*;
public class ChangePassword
{
private final static JKS j = new JKS();
public static void main(String[] args) throws Exception
{
@alexmarles
alexmarles / gist:2300251
Created April 4, 2012 10:39
Compass-rails in Mac OS X
$ bundle exec rails s
/Users/alex/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/sass-3.1.15/lib/sass/util.rb:332:in `rails_root': ERROR: Rails.root is nil! (RuntimeError)
from /Users/alex/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/sass-3.1.15/lib/sass/plugin/rails.rb:11:in `default_options'
from /Users/alex/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/sass-3.1.15/lib/sass/plugin/configuration.rb:33:in `options'
from /Users/alex/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/sass-3.1.15/lib/sass/plugin/compiler.rb:38:in `initialize'
from /Users/alex/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/sass-3.1.15/lib/sass/plugin.rb:63:in `new'
from /Users/alex/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/sass-3.1.15/lib/sass/plugin.rb:63:in `compiler'
from /Users/alex/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/sass-3.1.15/lib/sass/plugin.rb:120:in `options'
from /Users/alex/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/sass-3.1.15/lib/sass/plugin/rails.rb:
@alexmarles
alexmarles / gist:1250546
Created September 29, 2011 11:15
Error running rake db:migrate with rails 3.1
alex@manfred:~/projectes/brandchats$ rake db:migrate --trace
/home/alex/.rvm/gems/ruby-1.9.3-preview1@brandchats/gems/webbynode-1.0.4.3/lib/webbynode/io.rb:14: Use RbConfig instead of obsolete and deprecated Config.
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
can't convert nil into Hash
/home/alex/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/psych/visitors/to_ruby.rb:217:in `merge!'
/home/alex/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/psych/visitors/to_ruby.rb:217:in `block in revive_hash'
/home/alex/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/psych/visitors/to_ruby.rb:211:in `each'