Skip to content

Instantly share code, notes, and snippets.


Marc Riera mrcasals

Block or report user

Report or block mrcasals

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
mrcasals /
Created Dec 3, 2011 — forked from oriolgual/
Catalan translation for Devise
expired: "ha caducat, demana'n un de nou"
not_found: "no s'ha trobat"
already_confirmed: "ja està confirmat"
not_locked: "no està bloquejat"
one: "1 error ha evitat que %{resource} es pugui desar:"
other: "%{count} errors han evitat que %{resource} es pugui desar:"
mrcasals / gist:2788529
Created May 25, 2012
Rails: Reinstall postgreSQL via brew ang pg gem on Mac OS X
View gist:2788529
$ brew uninstall postgresql
$ gem uninstall pg # ALL OF THEM
$ rm -fr /usr/local/var/postgres
$ launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
$ pg_ctl -D /usr/local/var/postgres stop -s -m fast # WE SHOULD HAVE ALL postgres SERVERS & PROCESSES STOPPED BY NOW
$ brew install postgres
$ env ARCHFLAGS="-arch x86_64" gem install pg
$ echo "DONE." >> /dev/null
mrcasals /
Last active May 28, 2019
PCG & AI interesting links -

If you want to add links here, leave a comment or ping me by Twitter or GitHub (@mrcasals on both platforms). You can find my email in my GitHub profile too!


Books & papers

mrcasals / gist:8bb96e9925b528cdea19
Created Jun 16, 2014
GolTV a l'ordinador amb XBMC
View gist:8bb96e9925b528cdea19
Ara que ja he acabat exàmens i estem a mig mundial de futbol,
un tutorial ràpid per poder veure el mundial gratis des de
l'ordinador (i si s'enxufa, també a la tele!).
1) Instal·lar XBMC:
2) Baixar-se aquest arxiu ZIP a una carpeta coneguda:
3) Anar a Sistema -> Configuració -> Complements -> Instal·la
mrcasals / remove_local_merged_branches
Created Mar 20, 2013
A couple of scripts to remove merged git branches into master. I did not write them, but lost the source :(
View remove_local_merged_branches
git branch -d $( git branch --merged | grep -v '^\*' | grep -v 'master' )
View seeds.rb
@index ="my_custom_index")
@index.create :settings => {
:index => {
:analysis => {
:analyzer => {
:default => {
type: "snowball",
:language => 'Catalan'
mrcasals / gist:1904259
Created Feb 24, 2012
Octopress plugins ideas
View gist:1904259

Spotify API integration:

{% spotify spotify:track:0CMaT6vi0XdnOgtOTeOIEj %} spotify:track:0CMaT6vi0XdnOgtOTeOIEj || spotify:artist:3eqjTLE0HfPfh78zjh6TqT || spotify:user:mrc2407:playlist:2AS7HhXVysUciOk9fPxZ8f ||

Can use any of these in{url}


mrcasals / books_controller.rb
Created Oct 6, 2011
Rails Controllers with DataMapper
View books_controller.rb
# This class is responsible for the Books REST interface.
class BooksController < ApplicationController
# Get a book by the id
before_filter :get_book, only: [:edit, :update, :show, :destroy]
# Renders the form to create a new Book.
def new
mrcasals / ca.yml
Created Sep 1, 2011
LocaleApp doesn't keep the default Rails translations format
View ca.yml
# This is the default format for Rails Translations.
# You can see the full file here:
- Diumenge
- Dilluns
- Dimarts
- Dimecres
mrcasals / builderror.log
Created Oct 23, 2014
npm install couchbase
View builderror.log
In file included from ../src/
In file included from ../src/couchbase_impl.h:70:
../src/namemap.h:87:20: error: use of undeclared identifier 'NanPersistentToLocal'
return NanPersistentToLocal(names[ix]);
In file included from ../src/
In file included from ../src/couchbase_impl.h:72:
../src/cookie.h:109:38: error: expected '(' for function-style cast or type construction
NanAssignPersistent(v8::Value, parent, cbo);
You can’t perform that action at this time.