Skip to content

Instantly share code, notes, and snippets.


Carlos Equiz crustafari

Block or report user

Report or block crustafari

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
crustafari /
Created Sep 10, 2019 — forked from sloria/
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General


  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
import itertools
from operator import itemgetter
sorted_animals = sorted(animals, key=itemgetter('size'))
animals = [{'name':'cow', 'size':'large'},{'name':'bird', 'size':'small'},{'name':'fish', 'size':'small'},{'name':'rabbit', 'size':'medium'},{'name':'pony', 'size':'large'},{'name':'squirrel', 'size':'medium'},{'name':'fox', 'size':'medium'}]
for key, group in itertools.groupby(sorted_animals, key=lambda x:x['size']):
print key,
print list(group)
crustafari /
Last active Mar 16, 2020
Personal Python Cheat Sheet
# Getting class name
# UTC timestamp 2020-03-04T17:50:26.376Z
now = datetime.datetime.utcnow()
timestamp = now.strftime('%Y-%m-%dT%H:%M:%S') + \
'.%03d' % (now.microsecond / 1000) + 'Z'
# Jupyter arguments
crustafari / intro-functional-programming.js
Created Apr 29, 2019
A Functional Programmer’s Introduction to JavaScript from Eric Elliot's Composing Software
View intro-functional-programming.js
// A variable declared with the const keyword can’t be reassigned. This restriction is a good thing.
const hola = 'Hola';
const arreglo = [1, 2, 3];
const a = 'a';
const b = 'b';
View AccountType.php
namespace NoxLogic\DemoBundle\Form\Type;
use Doctrine\ORM\EntityManager;
use NoxLogic\DemoBundle\Entity\Province;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
You can’t perform that action at this time.