Skip to content

Instantly share code, notes, and snippets.

View AndersonFirmino's full-sized avatar
🐍
📜 🎼 🎮 🐧 🦆

Anderson Araujo AndersonFirmino

🐍
📜 🎼 🎮 🐧 🦆
View GitHub Profile

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@AndersonFirmino
AndersonFirmino / SingletonMongoClient.py
Created February 22, 2018 03:35 — forked from wowkin2/SingletonMongoClient.py
Python Singleton with parameters (so the same parameters get you the same object) with support to default arguments and passing arguments as kwargs (but no support for pure kwargs).
"""
Python Singleton with parameters (so the same parameters get you the same object)
with support to default arguments and passing arguments as kwargs (but no support for pure kwargs).
And implementation for MongoClient class from pymongo package.
"""
from pymongo import MongoClient
import inspect
@AndersonFirmino
AndersonFirmino / trampoline.py
Created January 15, 2018 23:34 — forked from ejconlon/trampoline.py
Tail-Recursion helper in Python
#!/usr/bin/env python
"""
Tail-Recursion helper in Python.
Inspired by the trampoline function at
http://jasonmbaker.com/tail-recursion-in-python-using-pysistence
Tail-recursive functions return calls to tail-recursive functions
(themselves, most of the time). For example, this is tail-recursive:
@AndersonFirmino
AndersonFirmino / Godot IAP.gd
Created January 5, 2018 22:34 — forked from FEDE0D/Godot IAP.gd
In app purchases in Godot Engine: Examples
# Intent: interface to the GodotPayments module (remember to add the java path in the project settings android>modules )
"Intent.gd"
extends Node
# Interface for the GodotPayments module
# To use extend this script and save the result on the Global singleton 'Data'
const STATIC_RESPONSE_NONE = 0
const STATIC_RESPONSE_ALL = 1
@AndersonFirmino
AndersonFirmino / spreadsheet.py
Created December 21, 2017 21:55 — forked from alchemyst/spreadsheet.py
Spreadsheet in 100 lines of Python
#!/usr/bin/env python
import tkinter as tk
import math
import re
from collections import ChainMap
Nrows = 5
Ncols = 5
@AndersonFirmino
AndersonFirmino / comoSerChatoNowhatsapp.js
Created October 18, 2017 16:17 — forked from callmeloureiro/comoSerChatoNoWhatsapp.js
Como fazer alguém te responder no whatsapp
var counter = 0;
var i = setInterval(function() {
window.InputEvent = window.Event || window.InputEvent;
var d = new Date();
var event = new InputEvent('input', {
bubbles: true
});
var textbox = document.querySelector('#main > footer > div.block-compose > div.input-container > div.pluggable-input.pluggable-input-compose > div.pluggable-input-body.copyable-text.selectable-text');
var textToSend = "Me responde!";
@AndersonFirmino
AndersonFirmino / underscore_dict.py
Created September 8, 2017 22:28 — forked from andrewwatts/underscore_dict.py
a dict that forces keys, which are likely camelCase, into under score keys.
class underscore_dict(dict):
"""
a dict like object that forces key to be pythonic and follow the underscore
convention.
eg::
>>> d = underscore_dict(dict(myKey='my_value'))
>>> print d
'my_key': 'my_value'}
@AndersonFirmino
AndersonFirmino / camel_case_to_snake_case.py
Created September 8, 2017 22:27 — forked from jaytaylor/camel_case_to_snake_case.py
Convert camel-case to snake-case in python.
#!/usr/bin/env python
"""
Convert camel-case to snake-case in python.
e.g.: CamelCase -> snake_case
Relevant StackOverflow question: http://stackoverflow.com/a/1176023/293064
"""
@AndersonFirmino
AndersonFirmino / mersenne-twister.js
Created August 30, 2017 16:25 — forked from banksean/mersenne-twister.js
a Mersenne Twister implementation in javascript. Makes up for Math.random() not letting you specify a seed value.
/*
I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace
so it's better encapsulated. Now you can have multiple random number generators
and they won't stomp all over eachother's state.
If you want to use this as a substitute for Math.random(), use the random()
method like so:
var m = new MersenneTwister();
@AndersonFirmino
AndersonFirmino / operator_with_ligatures.md
Created July 27, 2017 18:30 — forked from renatorib/operator_with_ligatures.md
Using Operator Mono with Fira Code ligatures in Atom.

Using Operator Mono with Fira Code ligatures in Atom.

  1. Open your Atom's Stylesheet
    image

  2. Put this css

atom-text-editor {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;