Skip to content

Instantly share code, notes, and snippets.

View berinhard's full-sized avatar
👾
let's play that

berin berinhard

👾
let's play that
View GitHub Profile
@berinhard
berinhard / restaurantes_sp.md
Last active March 14, 2022 20:40
Meus Restaurantes <3 de SP

DISCLAIMER

Essa lista é completamente pessoal e todas as indicações, em geral, ficam em bairros próximos aos bairros que eu morei em São Paulo. E sim, com cercerteza devem haver outros restaurantes que você moradora de São Paulo acha que faltou na lista. Mas haja dinheiro pra ser crítico gastrônimico em São Paulo, né querida?

LAMEN

Porque sim

@berinhard
berinhard / pcd-2021.py
Created February 14, 2021 15:20
Trilha Processing Community Day Brasil 2021
# Trilha para vídeo Processing Community Day Brasil 2021
# berin e vinícius
# niterói/lisboa - 14/02/2021 (domingo de carnaval)
Root.default = 'D'
Scale.default = 'minor'
Clock.set_time(0)
Clock.bpm = 120
var.base = var([0, 4, 3, 2, 1], dur=[12, 9, 1, 1, 1])
~d1 >> sinepad(
@berinhard
berinhard / py_simetria.py
Created November 5, 2020 15:59
Ess script implementa padrões por rotação e simetria no Processing em modo Python. Ele é uma versão final resultada da preparação para a palestra "Simetrias Pythônicas" apresentada na PythonBrasil 2020 por Bernardo Fontes
# Author: Berin
# Sketches repo: https://github.com/berinhard/sketches
largura = 900
altura = 900
tam_modulo = largura / 2
def modulo():
noStroke()
# quadrado para fundo branco
fill(230)
@berinhard
berinhard / img_symmetry.py
Created November 5, 2020 15:30
Given a set of images from the project thisartworkdoesnotexist.com, this script generates 16 imagens combining symmetries extracts from the image's quadrants.
# Author: Berin
# Sketches repo: https://github.com/berinhard/sketches
# requirements: pillow tqdm
import os
from multiprocessing import Pool
from PIL import Image, ImageOps
from pathlib import Path
from tqdm import tqdm
import shutil
var total = 5;
function new_image() {
var url = "https://thispersondoesnotexist.com/image";
window.open(url,'_blank');
}
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
@berinhard
berinhard / json_to_srt.py
Last active November 12, 2021 15:06
Gist do convert Amazon's transcribe JSON to SRT format
"""
$ python json_to_srt.py <json_filepath> <output_srt>
Reference: https://aws.amazon.com/blogs/machine-learning/create-video-subtitles-with-translation-using-machine-learning/
"""
import sys
import json
def getPhrasesFromTranscript( ts ):
@berinhard
berinhard / pyzza.py
Last active November 4, 2019 15:37
pyzza - processing modo python
from random import choice
PEQUENA, MEDIA, GRANDE, MARACANA = 200, 300, 600, 900
NUM_FATIAS = [4, 8, 12, 16]
def polar_coordinate(x0, y0, r, angle):
x = x0 + r * cos(angle)
y = y0 + r * sin(angle)
@berinhard
berinhard / from_mommy_to_bakery.py
Last active October 17, 2019 18:02 — forked from anapaulagomes/from_mommy_to_bakery.py
Helping people moving from model_mommy to model_bakery
"""
Migrate from model_mommy to model_bakery.
``python from_mommy_to_bakery.py --dry-run``
Please check your dependency files.
"""
import argparse
import os
@berinhard
berinhard / setup-foxdot-processing.md
Last active November 9, 2023 09:34
Setup de Algorave com Pythonn
@berinhard
berinhard / symmetry.py
Created June 26, 2019 18:23
Pythonic Symmetry
# Author: Berin
# Sketches repo: https://github.com/berinhard/sketches
from collections import namedtuple
from abc import ABCMeta, abstractmethod
WHITE = color(235, 235, 235)
BLACK = color(27, 27, 27)
BLUE = color(55,189,182)
def setup():