Skip to content

Instantly share code, notes, and snippets.

View josircg's full-sized avatar
🏠
Working from home

Josir Cardoso Gomes josircg

🏠
Working from home
View GitHub Profile
@ronaldalbrt
ronaldalbrt / AnaliseDeTweetsComPython.ipynb
Created November 16, 2021 15:37
Notebook minicurso de Análise de Tweets com Python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ramalho
ramalho / timeslice.py
Last active September 25, 2021 11:22
Abusing Python's T[4:20] syntax to make Time objects
"""
Could this be valid Python?
if now >= T[4:20:PM]: sextou()
>>> t = T[4:20]
>>> t
T[4:20]
@cauethenorio
cauethenorio / php-array-to-dict.py
Last active August 29, 2015 14:21
converter inputs de array (PHP) para um dict python
# coding: utf8
import re
from functools import reduce
def merge_dicts(*dicts):
# http://stackoverflow.com/questions/7204805/dictionaries-of-dictionaries-merge
if not reduce(lambda x, y: isinstance(y, dict) and x, dicts, True):
raise TypeError("Object in *dicts not of type dict")
@bert
bert / README
Last active October 22, 2022 22:16
Voronoi Diagram in python
On Jun 11, 2:01 pm, Robert Kern <robert.k... at gmail.com> wrote:
> On 2009-06-11 14:56, Captain___nemo wrote:
> > Please advice me very simple implementation of voronoi diagram (given
> > coordinates). Please advice me simple python code preferably without-
> > hash, multi-threading, Delaunay Traingulation,
>
> You can't really do the Voronoi diagram without Delaunay Triangulation. They are
> two ways of looking at the same thing.
@avram
avram / csv2zotero.py
Created July 16, 2011 11:16
Script to batch-add items defined in a CSV file to Zotero
#!/usr/bin/python
# -*- coding: utf8 -*-
# We'll use the pyzotero project for server access
# See packages.python.org/Pyzotero/
from pyzotero import zotero
import sys
# Python's built-in CSV support is pretty nice