Skip to content

Instantly share code, notes, and snippets.

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

Marcus Almeida marcuxyz

🏠
Working from home
View GitHub Profile
@marcuxyz
marcuxyz / requirements.txt
Last active October 28, 2022 13:17
Flask Masterclass requirements
alembic==1.8.1; python_version >= "3.7"
autoflake==1.4
black==22.6.0; python_full_version >= "3.6.2"
click-completion==0.5.2; python_full_version >= "3.7.8" and python_full_version < "4.0.0"
click-default-group==1.2.2; python_full_version >= "3.7.8" and python_full_version < "4.0.0"
click==8.1.3; python_full_version >= "3.7.8" and python_full_version < "4.0.0" and python_version >= "3.7"
colorama==0.4.5; platform_system == "Windows" and python_version >= "3.7" and python_full_version >= "3.7.8" and python_full_version < "4.0.0"
commonmark==0.9.1; python_full_version >= "3.7.8" and python_full_version < "4.0.0"
cssselect==1.1.0; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.4.0"
cucumber-tag-expressions==4.1.0; python_full_version >= "3.7.8" and python_full_version < "4.0.0" and python_version >= "2.7"
# https://edabit.com/challenge/G9QRtAGXb9Cu368Pw
from unittest import TestCase
from combination import combinations
class CombinationTest(TestCase):
def test_combination(self):
self.assertEqual(combinations(2), 2)
self.assertEqual(combinations(2, 3), 6)
@marcuxyz
marcuxyz / char.py
Last active December 12, 2020 14:19
char to int
num = (input("\nEntre com um numero entre 1 e 27 : "))
result = [ord(c) for c in num]
print(result)
# com while
result = []
while True:
c = (input("\nEntre com um numero entre 1 e 27 : "))
@marcuxyz
marcuxyz / template.md
Last active November 26, 2020 15:07
Yield and Render in ERB Without Ruby on Rails
require 'erb'

class Template
    def render(template_name="base")
        ERB.new(File.read("#{template_name}.erb")).result(binding)
    end
end

result = Template.new.render do
avatar: "https://content.arduino.cc/avatars/3/2n3904.jpeg"
author: "Marcus Pereira"
title: "Criando Componentes Com ReactJS"
description: "Aprenda a criar componentes com reactjs"
source_code: "https://github.com/marcuxyz/reactjs-components"
playlist:
- v01:
name: "01 - introdução"
url: "https://storage.negros.dev/media/course/criando-components-com-reactjs/aula01"
timestamp = `date +%s`
test:
@pytest --cov=./scanapi --cov-report=xml
check:
@black -l 80 --check . --exclude=.venv
change-version:
@marcuxyz
marcuxyz / fixture.py
Created September 26, 2020 13:34
fixture
@pytest.fixture
def create_database(app):
with app.app_context():
db.create_all()
yield db
db.session.remove()
db.drop_all()
@marcuxyz
marcuxyz / decorator.py
Created June 25, 2019 14:16
Criando decorator em python https://youtu.be/IK-ZbJHIiaI
def tudo_maiuscula(f):
def maiuscula():
return f().upper()
return maiuscula
@tudo_maiuscula
def olamundo():
return
@marcuxyz
marcuxyz / webpack.config.js
Created June 2, 2017 21:54
Webpack para Reactjs
const webpack = require('webpack')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
module.exports = {
entry: './src/index.jsx',
output: {
path: __dirname + '/public',
filename: './app.js'
},
devServer: {