Skip to content

Instantly share code, notes, and snippets.

View glauesppen's full-sized avatar
:octocat:
Focusing

Glaucia Esppenchutz glauesppen

:octocat:
Focusing
View GitHub Profile
@stantonk
stantonk / scalaforpy
Last active August 28, 2021 10:13
Scala for Python Programmers, examples
/*
Notes:
Despite Scala's appearances, it is, in fact, a Statically Typed language.
It has just eliminated a great deal of the "type vomit" people are used
to seeing in Statically Typed languages (e.g. C, C++, Java). It often
can infer the type on its own. It also combines functional and
object-oriented programming paradigms in a fashion that feels similar
to Python.
*/
@kelvintaywl
kelvintaywl / split.py
Last active October 8, 2024 08:21
Python Script to split CSV files into smaller files based on number of lines
import csv
import sys
import os
# example usage: python split.py example.csv 200
# above command would split the `example.csv` into smaller CSV files of 200 rows each (with header included)
# if example.csv has 401 rows for instance, this creates 3 files in same directory:
# - `example_1.csv` (row 1 - 200)
# - `example_2.csv` (row 201 - 400)
# - `example_3.csv` (row 401)
@marians
marians / CouchDB_Python.md
Last active June 14, 2025 02:00
The missing Python couchdb tutorial

This is an unofficial manual for the couchdb Python module I wish I had had.

Installation

pip install couchdb

Importing the module

@mpneuried
mpneuried / Makefile
Last active August 29, 2025 08:17
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@alexcasalboni
alexcasalboni / amazon-rekognition.md
Last active October 11, 2024 16:44
Amazon Rekognition - Python Code Samples

Amazon Rekognition - Python Code Samples

  1. Labels Detection
  2. Faces Detection
  3. Faces Comparison
  4. Faces Indexing
  5. Faces Search
from leilao.models import LanceProgramado
leilao = 'SEOP15-17'
lote = 2795
username = 'shirlene'
LanceProgramado.objects.filter(
lote__numero_do_lote_no_leilao=lote,
lote__leilao__nome=leilao,
user__username=username).values_list('ativo', flat=True)
from django.core.mail import EmailMessage
from contato.models import Newsletter
from django.contrib.auth.models import User
emails = ['[email protected]']
newsletter = set(Newsletter.objects.values_list('email', flat=True))
cadastrados = set(User.objects.filter(email__in=newsletter).values_list('email', flat=True))
fora_do_site = newsletter - cadastrados
from novo_financeiro.models import *
leilao = 'DIVSC05-17'
for nota in Nota.objects.filter(cache_dicionario__contains=leilao):
dicionario = nota.dicionario_do_cache()
dicionario['taxas'] = 0
nota.cache_dicionario = json.dumps(dicionario, cls=DjangoJSONEncoder)
nota.save()
@DrSensor
DrSensor / Advanced Markdown Tricks.md
Last active September 26, 2025 22:14
Advanced Markdown Tricks

Repository

What Will I Learn?

In general, you will learn some markdown tricks combined with standard HTML tags. In more details what you will learn:

  • Hide-show content
  • Writing codeblocks inside codeblocks
  • Combining and using italic, bold, superscript, subscript, and/or strikethrough
  • Quoting long sentence (using nested blockquotes)
@GusAntoniassi
GusAntoniassi / README.md
Last active September 30, 2025 18:42
Configure autocompletion to kubectl with zsh

kubectl with ZSH (oh-my-zsh)

How to configure

Use the following commands to add the kubectl autocomplete to zsh:

mkdir -p ~/.oh-my-zsh/custom/plugins/kubectl-autocomplete/
kubectl completion zsh > ~/.oh-my-zsh/custom/plugins/kubectl-autocomplete/kubectl-autocomplete.plugin.zsh