Skip to content

Instantly share code, notes, and snippets.

View umluizlima's full-sized avatar

Luiz Lima umluizlima

View GitHub Profile
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract MyToken is ERC20, Ownable {
constructor() ERC20("Pao de queijo", "PDQ") {
_mint(0x39d77B055155262e6856b1c41996bDD1b860B64A, 817 * 10 ** decimals());
}
@umluizlima
umluizlima / counting_sort.py
Created August 31, 2018 00:08
Counting Sort implementation.
"""
Counting sort implementation.
This module implements the counting_sort function.
>>> counting_sort([1, 4, 1, 2, 7, 5, 2])
[1, 1, 2, 2, 4, 5, 7]
"""
def counting_sort(l: list) -> list:
@umluizlima
umluizlima / tabuada.py
Created July 21, 2018 01:39
Tabuada_B
from random import randint
def tabuada():
equacao = f'{randint(1,9)} * {randint(1,9)}'
print(equacao.replace('*', 'x'))
return int(input('Resposta: ')) == eval(equacao)
acertos = 0
while(tabuada()):
acertos += 1
@umluizlima
umluizlima / tabuada.py
Last active July 21, 2018 01:05
Tabuada
def tabuada():
equacao = f'2 * 3'
print(equacao.replace('*', 'x'))
return int(input('Resposta: ')) == eval(equacao)
acertos = 0
while(tabuada()):
acertos += 1
print(f'Acertos: {acertos}')
import os
from subprocess import call
from flask import Flask, render_template, send_from_directory
app = Flask(__name__)
app.route('/')
def index():
return render_template('index.html')
"""DXF Ruler Generator.
This module generates DXF files for laser cutting and engraving custom sized
rulers, which can be easily manufactured at the nearest FabLab.
Example
-------
Generate a 7cm ruler:
$ python -m dxf_ruler_generator 7
@umluizlima
umluizlima / tab.py
Last active July 21, 2018 00:49
Tab
from random import randint
def tabuada():
s = f"{randint(1,9)} * {randint(1,9)}"
print(s.replace('*', 'x'))
return int(input('Resposta: ')) == eval(s)
record = 0
while(tabuada()):
record += 1