This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/python | |
| import subprocess | |
| print("---------------------------------------------------") | |
| print("Automatic Watched Set Up of Github in Python") | |
| print("-----------by Sham Vinicius Fiorin-----------------") | |
| print("---------------------------------------------------") | |
| config = input("Set up configurations[N/s]?") | |
| if('s' in config.lower()): | |
| subprocess.run(["git", "init"]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Mapper: | |
| def convertValue(self, data, obj): | |
| """ | |
| Mapper from dict to class, covering it's chieldrens but the key on dict must be mapping the chield with . | |
| Exemple: data = { | |
| "x": 0, | |
| "y": 1, | |
| "chield.a": "Sham Vinicius", | |
| "chield.b": "Fiorin", | |
| "chield.layer.c": "xxx", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import unittest | |
| def bobble_sort(values): | |
| """ | |
| Sorting list algorithm type of BobbleSort. | |
| Time O(n**2 - n) | |
| Space O(n + 3) | |
| :author sham vinicius fiorin | |
| :param values: List of comparable objects |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from abc import ABC, abstractmethod | |
| def main(): | |
| for obj in (LocalFinder(), ExternalFinder()): | |
| obj.explore() | |
| obj.comming_back() | |
| class FinderInterface(ABC): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| # Para versão 2, auxilia na pontução | |
| pontuacao = { | |
| 'G': 50, | |
| 'Q': 40, | |
| 'S+': 30, | |
| 'S-': 40, | |
| 'T': 20, | |
| 'A': "SOMA", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| Daily chalenge with GOF design pattern with python 3.6+ | |
| ''' | |
| base = [ | |
| { | |
| "type": "Creational Design Patterns", | |
| "patterns": [ | |
| "Abstract Factory. Allows the creation of objects without specifying their concrete type.", | |
| "Builder. Uses to create complex objects.", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from http.server import BaseHTTPRequestHandler, HTTPServer | |
| import time | |
| base = [ | |
| { | |
| "type": "Creational Design Patterns", | |
| "patterns": [ | |
| "Abstract Factory. Allows the creation of objects without specifying their concrete type.", | |
| "Builder. Uses to create complex objects.", | |
| "Factory Method. Creates objects without specifying the exact class to create.", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from random import randint | |
| import re | |
| def generate(size): | |
| unique_numbers = list() | |
| while(len(unique_numbers) < size): | |
| new_value = randint(1, 60) | |
| if (new_value not in unique_numbers): | |
| unique_numbers.append(new_value) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| import sqlite3 | |
| connection = sqlite3.connect('db.sqlite') | |
| cursor = connection.cursor() | |
| cursor.execute('Create Table if not exists Student (name Text, course Text, roll Integer)') | |
| traffic = json.load(open('json_file.json')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script lang="ts"> | |
| import { Field, Form, ErrorMessage } from 'vee-validate'; | |
| export default { | |
| components: { | |
| Form, | |
| Field, | |
| ErrorMessage | |
| }, | |
| methods: { |