Skip to content

Instantly share code, notes, and snippets.

View abelgvidal's full-sized avatar
🏠
Working from home

Abel González Vidal abelgvidal

🏠
Working from home
View GitHub Profile
@abelgvidal
abelgvidal / gist:79a921bf8127954e7b82f226b778769e
Last active October 25, 2023 10:22
Visualize a time series dataset using Python
import matplotlib.pyplot as plt
import datetime
# Dates and weights
dates = [
"Monday, August 28, 2023", "Wednesday, August 30, 2023", "Thursday, August 31, 2023",
"Friday, September 1, 2023", "Saturday, September 2, 2023", "Monday, September 4, 2023",
"Tuesday, September 5, 2023", "Wednesday, September 6, 2023", "Thursday, September 7, 2023",
"Friday, September 8, 2023", "Saturday, September 9, 2023", "Monday, September 10, 2023",
"Thursday, September 14, 2023", "Sunday, September 17, 2023", "Monday, September 18, 2023",
@abelgvidal
abelgvidal / sublime_hot_keys.txt
Created November 29, 2022 14:39 — forked from ollar/sublime_hot_keys.txt
sublime hot keys
Sublime Text 2 Tips
Useful URLs
http://www.sublimetext.com/dev
http://docs.sublimetext.info/en/latest
http://wesbos.com/sublime-text-code-folding
http://benmccormick.org/blog/2013/01/01/sublime-text-for-javascript-configuration/
Command Palette
Ctrl+Shift+P (Tools > Command Palette...)
@abelgvidal
abelgvidal / bash_template.sh
Created November 22, 2022 09:50
Template with best practices for bash scripting. source https://sharats.me/posts/shell-script-best-practices/
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
if [[ "${TRACE-0}" == "1" ]]; then
set -o xtrace
fi
if [[ "${1-}" =~ ^-*h(elp)?$ ]]; then
### this script checks for secrets (sensitive information) in a github repo
### usage ----
### checksecrets.sh git@github.com:prometheus-community/elasticsearch_exporter.git
#!/bin/bash
# Create a temporary directory and store its name in a variable.
TEMPD=$(mktemp -d)
REPO=$1
@abelgvidal
abelgvidal / gist:2a0a9e6bdc057e293c476a4ee1307384
Last active April 8, 2020 11:07
assume role for kubernetes
;; used as assume_aws production
regenerate_kubeconfig() {
echo "Configuring for ${1} environment\n"
if [ "${1}" = "production" ]; then
echo "Selecting production\n"
SRC_CLUSTER="stable-20200129"
else
echo "Selecting sandbox\n"
SRC_CLUSTER="unstable-20200128"
@abelgvidal
abelgvidal / gem_env.sh
Created March 18, 2018 10:41 — forked from thinkerbot/gem_env.sh
Illustrates GEM_HOME vs GEM_PATH
# Two ENV variables control the 'gem' command:
#
# GEM_HOME: the single path to a gem dir where gems are installed
# GEM_PATH: a standard PATH to gem dirs where gems are found
#
# A gem directory is a directory that holds gems. The 'gem' command will lay
# out and utilize the following structure:
#
# bin # installed bin scripts
# cache # .gem files ex: cache/gem_name.gem
@abelgvidal
abelgvidal / sparse-checkout
Created December 27, 2017 21:11 — forked from jmjf/sparse-checkout
An Ansible playbook and sparse-checkout file to test sparse checkout functionality
mu-plugins/
README.md
@abelgvidal
abelgvidal / ansible-github.yml
Created December 22, 2017 16:52 — forked from devynspencer/ansible-github.yml
Example playbook for cloning a private git repository with Ansible.
---
hosts: all
tasks:
- name: add github ssh key
copy: >
src=files/id_rsa.github
dest=/root/.ssh/id_rsa.github
owner=root
group=root
@abelgvidal
abelgvidal / ofertaHundred.md
Last active September 26, 2016 13:37
Si te gusta el desarrollo en HundredRooms te estamos buscando.

En HundredRooms buscamos completar nuestro equipazo de desarrollo y por ello estamos buscando compañeros para este viaje.

We are hiring

¿Qué hacemos?.

Desarrollamos el mejor buscador de apartamentos turísticos del mundo. Así de sencillo y así de complicado. Hacemos que sea fácil buscar en decenas de portales distintos a la vez con disponibilidad y precios reales. Para todos los países e idiomas. Vamos en serio. Hasta hacemos anuncios en la tele :)

Tenemos financiación y una hoja de ruta para ser los líderes del sector.

@abelgvidal
abelgvidal / postgres-cheatsheet.md
Last active January 21, 2016 17:08 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

Magic words:

psql -U postgres

If run with -E flag, it will describe the underlaying queries of the \ commands (cool for learning!).

Most \d commands support additional param of __schema__.name__ and accept wildcards like *.*

  • \q: Quit/Exit
  • \c __database__: Connect to a database