Skip to content

Instantly share code, notes, and snippets.

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

Sham skatesham

🏠
Working from home
View GitHub Profile
@skatesham
skatesham / sena.py
Last active December 27, 2023 16:06
Mega sena script - 6 numbers game paid R$ 4,50 - Best run teh script then start playing
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)
@skatesham
skatesham / StatePattern.java
Last active April 27, 2023 21:13
State experimental Pattern
package com.sham.vinicius.fiorin;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import java.math.BigDecimal;
import java.util.List;
/**
@skatesham
skatesham / StrategyVisitor.java
Last active April 6, 2023 00:33
Pattern Strategy With Visitor Embeded in Enum on Domain Object
package core.chapadaguides;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.ToString;
import java.math.BigDecimal;
import java.util.List;
@skatesham
skatesham / AppWithLocalStorage.vue
Created December 30, 2022 17:27 — forked from lorisleiva/AppWithLocalStorage.vue
Abstraction of the local storage using Vue3's composition API
<script setup>
import useLocalStorage from './useLocalStorage'
const publicKey = useLocalStorage('solana-wallet-public-key')
</script>
<template>
<div>
<input type="text" v-model="publicKey">
<div v-text="publicKey"></div>
</div>
@skatesham
skatesham / VeeValidate.vue
Created October 26, 2022 07:00
VeeValidate Hellow World
<script lang="ts">
import { Field, Form, ErrorMessage } from 'vee-validate';
export default {
components: {
Form,
Field,
ErrorMessage
},
methods: {
@skatesham
skatesham / python-json-to-sqlite3.py
Created August 23, 2022 23:05
Get list json and send to table jsqlite
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'))
@skatesham
skatesham / gof-server.py
Created November 26, 2021 07:00
Server chalenge gof
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.",
@skatesham
skatesham / gof_chalenge.py
Created November 26, 2021 06:35
Daily chalenge with GOF design pattern with python 3.6+
'''
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.",
@skatesham
skatesham / yahtzee-game.py
Last active July 13, 2021 01:08
Yahtzee Game with Python 3 (command line)
import random
# Para versão 2, auxilia na pontução
pontuacao = {
'G': 50,
'Q': 40,
'S+': 30,
'S-': 40,
'T': 20,
'A': "SOMA",
@skatesham
skatesham / overriding_method_polymorphic.py
Last active October 23, 2020 03:07
Polymorphism and Abstract Method Overriding implementing an Interface
from abc import ABC, abstractmethod
def main():
for obj in (LocalFinder(), ExternalFinder()):
obj.explore()
obj.comming_back()
class FinderInterface(ABC):