Skip to content

Instantly share code, notes, and snippets.

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

Anderson Araujo AndersonFirmino

🐍
📜 🎼 🎮 🐧 🦆
View GitHub Profile
@Lucas-C
Lucas-C / convert_report_to_cucumber_format.py
Last active March 7, 2018 14:40
Behave to Cucumber JSON report converter
#!/usr/bin/env python
# USAGE: ./convert_report_to_cucumber_format.py --behave-report bdd/report.json [--json-schema cucumber-report-schema.json]
import argparse, json, sys
from jsonschema import Draft4Validator
def main(argv=None):
args = parse_args(argv)
@wowkin2
wowkin2 / SingletonMongoClient.py
Created May 14, 2016 17:20
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
@kayhadrin
kayhadrin / js-timeout-polyfill.js
Last active December 10, 2024 21:39
Nashorn setTimeout polyfill
/**
* js-timeout-polyfill
* @see https://blogs.oracle.com/nashorn/entry/setinterval_and_settimeout_javascript_functions
*/
(function (global) {
'use strict';
if (global.setTimeout ||
global.clearTimeout ||
global.setInterval ||
@FEDE0D
FEDE0D / Godot IAP.gd
Created February 1, 2016 16:00
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
@diegorocha
diegorocha / exemplo-subprocess.py
Created January 18, 2016 19:40
Exemplo de interação com outros processos usando o modulo subprocess
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess
#Obtem o RETURN CODE de um programa, no caso o pwd
value = subprocess.call('pwd')
print value
#Obtem a saída normal (stdout) de um programa, no caso o pwd
@TheWaWaR
TheWaWaR / flask_dump_request_response.py
Last active December 30, 2024 03:39
Flask dump request and response example
#!/usr/bin/env python
# coding: utf-8
import os
import sys
import json
import uuid
import tempfile
from flask import Flask, request, Response, g
@onlurking
onlurking / 2048.py
Last active November 4, 2018 18:57
Python 3 port and PEP8 compliant version of David Sousa's 2048 game, to run install the latest version of pygame with python 3: https://bitbucket.org/pygame/pygame/get/default.zip, original source: https://github.com/davidsousarj/2048py/blob/master/2048py.py
# 2048.py
# Written in python / pygame by DavidSousaRJ - [email protected]
# License: Creative Commons
# Sorry about some comments in portuguese!
import os
import sys
import pygame
from pygame.locals import *
from random import randint
@tokhi
tokhi / unixToolbox.md
Last active October 10, 2024 16:30
Collection of Unix/Linux/BSD commands and tasks which are useful for IT work or for advanced users.

#Unix Toolbox

This document is a collection of Unix/Linux/BSD commands and tasks which are useful for IT work or for advanced users. This is a practical guide with concise explanations, however the reader is supposed to know what s/he is doing.

##Unix Toolbox revision 14.4

The latest version of this document can be found at http://cb.vu/unixtoolbox.xhtml. Replace .xhtml on the link with .pdf for the PDF version and with .book.pdf for the booklet version. On a duplex printer the booklet will create a small book ready to bind. This XHTML page can be converted into a nice PDF document with a CSS3 compliant application (see the script example). See also the about page.
Error reports and comments are m
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@revett
revett / git_branch_naming.md
Last active December 22, 2023 17:12
Git Branch Naming Conventions

Syntax

<author>/<type>/<ticket>/<title>

Example

revett/feature/24101/skeleton-service-for-email-sender