Skip to content

Instantly share code, notes, and snippets.

View DavidEGx's full-sized avatar

David Escribano García DavidEGx

View GitHub Profile
@DavidEGx
DavidEGx / bga_carcassonne_issue.md
Last active January 16, 2024 12:03
BGA CIP Template

BGA Carcassonne Improvement Proposal #Number

🏷️ Name

Issue name

📈 Status

Draft|Proposed|Fixed|Deprecated|Rejected

Where Draft: Working on a proposal.

/**
* This Google Sheets script keeps data in the specified column sorted any time
* the data changes.
*
* After much research, there wasn't an easy way to automatically keep a column
* sorted in Google Sheets, and creating a second sheet to act as a "view" to
* my primary one in order to achieve that was not an option. Instead, I
* created a script that watches for when a cell is edited and triggers
* an auto sort.
*
@DavidEGx
DavidEGx / display_letter.js
Last active February 11, 2022 09:48
BGA display letters on empty places
/*
Usage:
1. Go to some BGA Carcassonne game, review,
and jump to the point you are interested in.
2. Open developer console (F12)
3. Go to console tab.
4. Paste code below.
Alternative to that, you can create a new bookmark in your browser pointing at:
@DavidEGx
DavidEGx / perlpython.txt
Last active July 23, 2019 13:30
Perl Python cheatsheet
+-------------------------------------------------------------------------------------------------------------------------------+
| Feature Perl Python |
+-------------------------------------------------------------------------------------------------------------------------------+
| Documentation perlpod docstrings |
| check doc perldoc MODULE class.__doc__ |
| Filter grep { COND } @array [ x for x in list if COND ] |
| Format strings "x: $x" "x: {}".format(x) |
| "x: {x}"
@DavidEGx
DavidEGx / .bash_prompt
Last active January 11, 2019 11:57
Bash prompt
################################################################################
# -------------------------
# BASH PROMPT CONFIGURATION
# -------------------------
# Description:
# Shows a nicer bash prompt:
# ▶ 🖳 mypc ▶ documents ▶ ⎇ master ▶ 𝍠 ✔
# -------- --------- ---------- --- -----
# | | | | |
# hostname folder git branch jobs last command result
@DavidEGx
DavidEGx / .vimsql
Last active August 29, 2015 14:09
Mysql vim console with Conque
" vim:fdm=marker
" Info {{{
" Description:
" This vimrc starts a new mysql terminal automatically providing syntax
" highlighting and other features to the mysql client.
" Check the mappings to see some useful stuff.
"
" Installation:
" If you you are using vundle in your normal vim just copy this file to
@DavidEGx
DavidEGx / old Bash prompt
Last active January 11, 2019 11:56
Bash prompt with git, error and background jobs information
# Description
# ===========
# This will change your prompt to something useful like:
#
# david@dgarciapc/fix-flux-capacitor:~/projects/manhattan #2 :) $
# ----- ----- ----- ----- - |
# | | | | |
# user hostname git branch current folder jobs last command result
#
# If the last command exit with an error the last bit will change to :(
@DavidEGx
DavidEGx / finish.pl
Created March 14, 2013 17:54
Some tasks i want to run when a amule download is finished
#!/usr/bin/perl
# ----------------------------------------------------------------------------
# Ejecuta ciertas tareas cuando un fichero se descarga.
# Info amule: http://wiki.amule.org/index.php/Events
#
# Tareas ejecutadas:
# - Se crean tantos enlaces duros como carpetas existan en @folders. Al tener
# cada usuario una carpeta independiente esto posibilita que un usuario se
# descargue un fichero y lo pueda eliminar inmediatamente.
# El fichero existira hasta que todos los usuarios lo borren.
@DavidEGx
DavidEGx / alog.sh
Created February 24, 2013 16:56
Example of tailing a log file with some colors using grep
#!/bin/bash
# Tail an apache log an put some colors into the output
# www.davideg.es
shopt -s expand_aliases
alias grey-grep="GREP_COLOR='1;30' grep -E --color=always --line-buffered"
alias red-grep="GREP_COLOR='1;31' grep -E --color=always --line-buffered"
alias green-grep="GREP_COLOR='1;32' grep -E --color=always --line-buffered"
alias yellow-grep="GREP_COLOR='1;33' grep -E --color=always --line-buffered"