Skip to content

Instantly share code, notes, and snippets.

View mrcasals's full-sized avatar
👨‍🚀
🚀

Marc Riera mrcasals

👨‍🚀
🚀
View GitHub Profile
@mrcasals
mrcasals / PCG_AI.md
Last active October 28, 2020 14:58
PCG & AI interesting links - nucl.ai

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!

PCG

Books & papers

@mrcasals
mrcasals / gather_locale_files.rb
Created August 12, 2020 12:52
Gather locale files for Decidim - REQUIRES ZSH
# THIS REQUIRES ZSH
# Create the file structure:
system("ls decidim-*/config/locales/*.yml | xargs -I % dirname % | xargs -I % mkdir -p yamls/%")
# List of official locales
official_locales = %w(
bg
hr
cs
@mrcasals
mrcasals / devise.ca.yml
Created December 3, 2011 17:57 — forked from oriolgual/devise.ca.yml
Catalan translation for Devise
ca:
errors:
messages:
expired: "ha caducat, demana'n un de nou"
not_found: "no s'ha trobat"
already_confirmed: "ja està confirmat"
not_locked: "no està bloquejat"
not_saved:
one: "1 error ha evitat que %{resource} es pugui desar:"
other: "%{count} errors han evitat que %{resource} es pugui desar:"
@mrcasals
mrcasals / gist:2788529
Created May 25, 2012 14:50
Rails: Reinstall postgreSQL via brew ang pg gem on Mac OS X
$ 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
mrcasals / gist:8bb96e9925b528cdea19
Created June 16, 2014 20:53
GolTV a l'ordinador amb XBMC
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!).
Passos:
1) Instal·lar XBMC: http://xbmc.org/download/
2) Baixar-se aquest arxiu ZIP a una carpeta coneguda:
https://github.com/Juarrox/palcotv.repository/raw/master/zips/plugin.video.palcotv-0.2.7.zip
3) Anar a Sistema -> Configuració -> Complements -> Instal·la
@mrcasals
mrcasals / remove_local_merged_branches
Created March 20, 2013 13:50
A couple of scripts to remove merged git branches into master. I did not write them, but lost the source :(
git branch -d $( git branch --merged | grep -v '^\*' | grep -v 'master' )
@index = Tire::Index.new("my_custom_index")
@index.delete
@index.create :settings => {
:index => {
:analysis => {
:analyzer => {
:default => {
type: "snowball",
:language => 'Catalan'
@mrcasals
mrcasals / gist:1904259
Created February 24, 2012 22:38
Octopress plugins ideas

Spotify API integration:

{% spotify spotify:track:0CMaT6vi0XdnOgtOTeOIEj %} spotify:track:0CMaT6vi0XdnOgtOTeOIEj || http://open.spotify.com/track/0CMaT6vi0XdnOgtOTeOIEj spotify:artist:3eqjTLE0HfPfh78zjh6TqT || http://open.spotify.com/artist/3eqjTLE0HfPfh78zjh6TqT spotify:user:mrc2407:playlist:2AS7HhXVysUciOk9fPxZ8f || http://open.spotify.com/user/mrc2407/playlist/2AS7HhXVysUciOk9fPxZ8f

Can use any of these in http://ws.spotify.com/lookup/1/.json?uri={url}

Example: http://ws.spotify.com/lookup/1/.json?uri=http://open.spotify.com/track/2CDqQmDdYQfkCNoRwR14nt

@mrcasals
mrcasals / books_controller.rb
Created October 6, 2011 18:17
Rails Controllers with DataMapper
# 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
mrcasals / ca.yml
Created September 1, 2011 12:56
LocaleApp doesn't keep the default Rails translations format
# This is the default format for Rails Translations.
# You can see the full file here:
# https://github.com/svenfuchs/rails-i18n/blob/master/rails/locale/ca.yml
ca:
date:
day_names:
- Diumenge
- Dilluns
- Dimarts
- Dimecres