Skip to content

Instantly share code, notes, and snippets.

View jag-k's full-sized avatar
Make a Weather in OpenWeather

Jag_k jag-k

Make a Weather in OpenWeather
View GitHub Profile
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>Now Playing</title>
<style>
body, html {
height: 100%;
margin: 0;
font-family: Arial, Helvetica, sans-serif;
@jag-k
jag-k / GUI.py
Created February 23, 2019 10:59
Smart GUI for pygame on Python3
__author__ = "Jag_k"
__github__ = "https://github.com/jag-k"
from PIL import Image
import pygame
from pygame.locals import *
import time
pygame.init()
a, b, c = map(int, (input(), input(), input()))
count = (b - a) // c + (b - a) % c if c == 2 else 0
if not count:
while a < b:
a += (bool((a + 2) % c) + 1)
count += 1
print(count)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<style>
.fa-bars {
cursor: move;
@jag-k
jag-k / index.html
Last active September 6, 2018 19:38
JS Bin// source http://jsbin.com/zofiguy
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<style>
.fa-bars {
cursor: move;
class Division:
def __init__(self, var1: int, var2: int):
var1, var2 = map(int, (var1, var2))
self.res = str(var1 // var2) + "."
self.var1 = var1 % var2 * 10
self.var2 = var2
def result(self, accuracy=100) -> float:
if (self.var1 % self.var2 or self.var1 // self.var2) and accuracy:
self.res += str(self.var1 // self.var2)
from VKBotAPI import LOGIN_DATA, api
import requests
token = LOGIN_DATA['token']
api_url = 'https://api.vk.com/method/docs.get%sUploadServer'
def doc_save(filedata, doc_type='doc'):
res = api.docs.save(file=filedata)[0]
print(res)
return "%s%s_%s" % (doc_type, res['owner_id'], res['did'])
if 'win' in sys.platform:
try:
import colorama
colorama.init()
ERROR_STRING = '\x1b[31;1mError\x1b[0;1m (\x1b[36;1m%s\x1b[1m): \x1b[4;1m%s\x1b[0m'
except ImportError:
ERROR_STRING = 'Error (%s): %s'
else:
ERROR_STRING = '\x1b[31;1mError\x1b[0;1m (\x1b[36;1m%s\x1b[1m): \x1b[4;1m%s\x1b[0m'
from VKBotAPI import api
import requests
url = api.docs.getMessagesUploadServer(type='doc', peer_id=173996641)['upload_url']
res = requests.post(url, {'file': open('./.logs/31.01.2018 21:03.log')})
print(res.json())
@jag-k
jag-k / THECOLOR.py
Last active February 18, 2018 16:24
{'aliceblue': (240, 248, 255, 255),
'antiquewhite': (250, 235, 215, 255),
'antiquewhite1': (255, 239, 219, 255),
'antiquewhite2': (238, 223, 204, 255),
'antiquewhite3': (205, 192, 176, 255),
'antiquewhite4': (139, 131, 120, 255),
'aquamarine': (127, 255, 212, 255),
'aquamarine1': (127, 255, 212, 255),
'aquamarine2': (118, 238, 198, 255),
'aquamarine3': (102, 205, 170, 255),