Skip to content

Instantly share code, notes, and snippets.

View eduardo-matos's full-sized avatar

Eduardo Matos eduardo-matos

View GitHub Profile
@mutewinter
mutewinter / package.json
Created October 4, 2016 21:28
Use Jest with CoffeeScript
{
"jest": {
"moduleFileExtensions": [
"js",
"json",
"jsx",
"node",
"coffee"
],
"preprocessorIgnorePatterns": [ ],
@jesstelford
jesstelford / event-loop.md
Last active June 7, 2024 17:12
What is the JS Event Loop and Call Stack?

Regular Event Loop

This shows the execution order given JavaScript's Call Stack, Event Loop, and any asynchronous APIs provided in the JS execution environment (in this example; Web APIs in a Browser environment)


Given the code

/*****************************************************************************
* __ __ _ _ ___ _
* \ \/ _\ /\/\ (_)_ __ | |_ _ _ / __\ __ ___ ___| |__
* \ \ \ / \| | '_ \| __| | | | / _\| '__/ _ \/ __| '_ \
* /\_/ /\ \ / /\/\ \ | | | | |_| |_| | / / | | | __/\__ \ | | |
* \___/\__/ \/ \/_|_| |_|\__|\__, | \/ |_| \___||___/_| |_|
* |___/
*
* Identifying and Eliminating Code Smells
*
@SkyM
SkyM / pre-commit
Created January 19, 2012 17:57
git pre-commit hook to stop bad words
#!/usr/bin/env ruby
FORBIDDEN = [
/\bdebugger\b/,
/\bfuck\b/,
/\bshit\b/,
/\bbitch\b/,
/\bwtf\b/,
/\bconsole\.debug\b/,
/\bLorem\.ipsum\.dolor\.sit\.amet\b/,
@dokterbob
dokterbob / admin.py
Created February 15, 2011 20:00
InlineAdmin mixin limiting the selection of related items according to criteria which can depend on the current parent object being edited.
class LimitedAdminInlineMixin(object):
"""
InlineAdmin mixin limiting the selection of related items according to
criteria which can depend on the current parent object being edited.
A typical use case would be selecting a subset of related items from
other inlines, ie. images, to have some relation to other inlines.
Use as follows::