Skip to content

Instantly share code, notes, and snippets.

View fmariluis's full-sized avatar

Franco Mariluis fmariluis

View GitHub Profile
@fmariluis
fmariluis / ecs_describer.py
Created March 24, 2021 01:01
Dumb python script to retrieve the public IP of the EC2 instances where ECS services run
"""Retrieves the public IP of the EC2 instance where an ECS service is running.
Requirements:
boto3
click
tabulate==0.8.7
"""
import boto3
from tabulate import tabulate
import click

Keybase proof

I hereby claim:

  • I am fmariluis on github.
  • I am fmariluis (https://keybase.io/fmariluis) on keybase.
  • I have a public key whose fingerprint is 4420 3D17 4D84 25B9 6189 AD53 7191 C5B4 58E4 4A60

To claim this, I am signing this object:

@fmariluis
fmariluis / new_gist_file
Created August 23, 2013 20:40
Basic Jinja2 workflow
import jinja2
templateLoader = jinja2.FileSystemLoader(searchpath="templates")
templateEnv = jinja2.Environment(loader=templateLoader)
templateEnv.trim_blocks = True
template = templateEnv.get_template(TEMPLATE_FILE)
templateVars = {
"nombre_tabla": "ubicaciones",
"lista_campos": campos,
@fmariluis
fmariluis / config.fish
Created August 22, 2013 19:05
Basic configuration for Fish Shell
set -xg PYTHONPATH /opt/eleccion/ $PYTHONPATH
set -xg PYTHONPATH /opt/operaciones/ $PYTHONPATH
set -xg GOROOT /usr/local/go $GOROOT
set -xg PATH /usr/local/go/bin $PATH
set -xg EDITOR vim $EDITOR
setenv EDITOR vim
function l
ll $argv
@fmariluis
fmariluis / new_gist_file
Created June 18, 2013 14:49
Create unique id field for a view in PostgreSQL
SELECT * FROM
( SELECT
ROW_NUMBER() OVER (ORDER BY column_to_sort_by ASC) AS ROW_NUMBER,
Col1, Col2
FROM table_name
) myview_name
@fmariluis
fmariluis / validators.py
Created May 16, 2013 18:33
Some custom validators for Argentina. Useful for Django
def phone_validator(value):
"""
Valida un teléfono de Argentina con código de área
10 dígitos, sin 0 al comienzo ni caracteres como - o ()
"""
pattern = '^[0]|\D'
if len(value) != 10:
raise ValidationError("Verifique la cantidad de dígitos. Deben ser 10 sin el \
15 e incluyendo el código de área")
@fmariluis
fmariluis / extra_fields.py
Created May 16, 2013 12:24
Custom Django field to save binary data Django < 1.5 http://djangosnippets.org/snippets/1597/
import base64
from django.db import models
class Foo(models.Model):
_data = models.TextField(
db_column='data',
blank=True)
@fmariluis
fmariluis / elements.md
Created November 18, 2011 18:24 — forked from soveran/elements.md
Excerpts from The Elements of Programming Style. The source of this compilation is unknown.

The Elements of Programming Style

The following rules of programming style are excerpted from the book "The Elements of Programming Style" by Kernighan and Plauger, published by McGraw Hill. Here is quote from the book: "To paraphrase an observation in The Elements of Style by Strunk and White, the rules of programming style, like those of English, are sometimes broken, even by the best writers. When a rule is broken, however, you will usually find in the program some compensating merit, attained at the cost of the violation. Unless you are certain of doing as well, you will probably do best to follow the rules."

@fmariluis
fmariluis / .vimrc
Created July 30, 2011 16:24 — forked from jeresig/.vimrc
VIM Config
au BufRead,BufNewFile jquery.*.js set ft=javascript syntax=jquery
set nocompatible
set autoindent
set tabstop=2
set showmatch
set vb t_vb=
set ruler
set nohls
set incsearch
syntax on