Skip to content

Instantly share code, notes, and snippets.

/** App Script para crear eventos apartir de emails (https://script.google.com/home/start)
*
* Hay que configurar que el script se corra automáticamente cada X cantidad de tiempo.
* El script hace lo siguiente:
* 1. Busca los mails con el label `calendar-event`
* 2. Por cada email chequea que sea alguno de un servicio, si es crea eventos
* 3. Saca label del mail
*
* Es necesario que desde gmail se creen reglas para agregar el label `calendar-event` a todos los mails a ser procesados.
*/
@dikaoru
dikaoru / rspec_model_testing_template.rb
Created May 14, 2020 12:26 — forked from PWSdelta/rspec_model_testing_template.rb
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems:
@dikaoru
dikaoru / postgres-cheatsheet.md
Created April 17, 2020 15:47 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@dikaoru
dikaoru / docker-compose-cheatsheet.sh
Created April 16, 2020 14:05 — forked from buonzz/docker-compose-cheatsheet.sh
docker-compose cheatsheet
$ docker-compose up -d # start containers in background
$ docker-compose kill # stop containers
$ docker-compose up -d --build # force rebuild of Dockerfiles
$ docker-compose rm # remove stopped containers
$ docker ps # see list of running containers
$ docker exec -ti [NAME] bash # ssh to the container
# list all images
docker images
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dikaoru
dikaoru / JS-LINQ.js
Created April 10, 2018 14:12 — forked from DanDiplo/JS-LINQ.js
JavaScript equivalents of some common C# LINQ methods. To help me remember!
// JS array equivalents to C# LINQ methods - by Dan B.
// Here's a simple array of "person" objects
var people = [
{ name: "John", age: 20 },
{ name: "Mary", age: 35 },
{ name: "Arthur", age: 78 },
{ name: "Mike", age: 27 },
{ name: "Judy", age: 42 },
{ name: "Tim", age: 8 }
@dikaoru
dikaoru / 0_reuse_code.js
Created February 10, 2016 17:40
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console