Skip to content

Instantly share code, notes, and snippets.

View tkovs's full-sized avatar
🤜
🤛

tkovs tkovs

🤜
🤛
View GitHub Profile
# name: items.py
import scrapy
class Quote(scrapy.Item):
author = scrapy.Field()
# name: quotes.py
# -*- coding: utf-8 -*-
import scrapy
class ranking(scrapy.Spider):
name = 'ranking'
allowed_domains = ['yugiohrpgonline.com.br']
start_urls = ['https://www.yugiohrpgonline.com.br/clan/SET/ranking/week/']
def parse(self, response):
formdata = {
'login': 'user',
@tkovs
tkovs / database.cs
Last active March 26, 2017 20:31
Slat's database
using Unity.Engine;
using System.Collections;
public class SlatDatabase : MonoBehaviour
{
private void Start()
{
if (!PlayerPrefs.HasKey("progress"))
{
this.initialize();
@tkovs
tkovs / colortrans.py
Created August 2, 2016 18:32 — forked from MicahElliott/colortrans.py
Convert values between RGB hex codes and xterm-256 color codes.
#! /usr/bin/env python
""" Convert values between RGB hex codes and xterm-256 color codes.
Nice long listing of all 256 colors and their codes. Useful for
developing console color themes, or even script output schemes.
Resources:
* http://en.wikipedia.org/wiki/8-bit_color
* http://en.wikipedia.org/wiki/ANSI_escape_code
@tkovs
tkovs / livraria.sql
Last active December 21, 2015 09:08
Banco de dados para projeto de POO
CREATE TABLE cliente (
cpf VARCHAR(11) PRIMARY KEY,
nome VARCHAR(35),
telefone VARCHAR(20),
cidade VARCHAR(20)
);
CREATE TABLE fornecedor (
cnpj VARCHAR(18) PRIMARY KEY,
nome VARCHAR(35),
@tkovs
tkovs / total a pagar.sql
Last active November 18, 2015 00:47
[RESOLVIDO] Dúvida sobre QUERY
Tenho as seguintes tabelas:
SELECT * FROM cliente;
id nome celular
---------- ---------- ----------
1 Joao 981******
2 Nivaldo 981******
3 Layse 981******
4 Raimundo 981******
-`
.o+` tkovs@toby
`ooo/ OS: Arch Linux
`+oooo: Kernel: x86_64 Linux 4.1.6-1-ARCH
`+oooooo: Uptime: 4h 11m
-+oooooo+: Packages: 1180
`/:-:++oooo+: Shell: bash 4.3.39
`/++++/+++++++: Resolution: 1366x768
`/++++++++++++++: WM: OpenBox
`/+++ooooooooooooo/` WM Theme: Real-milk
@tkovs
tkovs / palindrome.hs
Created August 19, 2015 00:03
"Crie um programa que verifique se um número é palíndromo em binário!"
palindrome :: Eq a => [a] -> Bool
palindrome a = (equals a (reverse' a))
bin :: Int -> [Int]
bin 0 = []
bin x = bin (div x 2) ++ [mod x 2]
reverse' :: [a] -> [a]
reverse' [] = []
reverse' (x:xs) = reverse' xs ++ [x]
@tkovs
tkovs / Mortivacional.hs
Last active August 29, 2015 14:27 — forked from haskellcamargo/Mortivacional.hs
Mortivacional.hs
module Mortivacional where
import System.Console.ANSI
drawLine :: IO ()
drawLine = putStrLn $ replicate 23 '-'
turnRed :: IO ()
turnRed = setSGR [ SetConsoleIntensity BoldIntensity
, SetColor Foreground Vivid Red
]