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 / 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 / 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():
@berinhard
berinhard / fixes.py
Created May 27, 2019 12:12
Fixes for Ale's sketch
# Alexandre B A Villares - https://abav.lugaralgum.com/sketch-a-day
# More explorations of lines in grids
from pytop5js import *
W = None
H = None
num = None
line_combos = None
@berinhard
berinhard / processing_gcode_generator.pde
Last active March 30, 2019 18:51
Simple processing Sketch to generate .gcode files for all SVGs in a directory
/*
This sketch is an adaptation from Sighack's Gcode Export
Blog post: https://sighack.com/post/processing-boilerplate-with-gcode-export
*/
import geomerative.*;
/*
* Gcode-generation settings. Edit these as per your needs.
* CONFIG_SVGS_DIR : Directory containing the SVG files
* CONFIG_PRINT_WIDTH_MM : The width of paper in mm
@berinhard
berinhard / example_006.py
Created March 29, 2019 17:29
Exemplo 006
import math
class Posicao():
def __init__(self, lat, lng):
self.lat, self.lng = lat, lng
@property
def lat(self):
return math.degree(self.phi)
@berinhard
berinhard / paperboy_003.py
Created March 22, 2019 19:17
Paperboy 003
class Wallet:
def __init__(self, money):
self.money = money
def subtract(self, amount):
self.money -= amount
def add(self, amount):
self.money += amount
@berinhard
berinhard / paperboy_002.py
Last active March 22, 2019 19:14
Paperboy 002
class Wallet:
def __init__(self, money):
self.money = money
def subtract(self, amount):
self.money -= amount
def add(self, amount):
self.money += amount
@berinhard
berinhard / paperboy_001.py
Created March 21, 2019 19:53
Paperboy 001
class Wallet:
def __init__(self, money):
self.money = money
def subtract(self, amount):
self.money -= amount
def add(self, amount):
self.money += amount
@berinhard
berinhard / exemplo_005.py
Created March 18, 2019 20:49
Exemplo 005
import math
class Posicao():
def __init__(self, lat, lng):
self.lat, self.lng = lat, lng
self.geometria = GeometriaPlana()
self.unidade = UnidadeQuilometro()
@property
@berinhard
berinhard / exemplo_004.py
Created March 18, 2019 20:47
Exemplo 004
import math
class Posicao():
PLANA, ESFERICA, ELIPTICA = 'plana', 'esferica', 'eliptica'
KM, M, MILHAS = 'kms', 'm', 'miles'
def __init__(self, lat, lng):
self.lat, self.lng = lat, lng
self.geometria = self.PLANA
self.unidade = self.KM