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
steamos-readonly disable | |
pacman-key --init | |
pacman-key --populate archlinux | |
pacman-key --refresh-keys | |
pacman -Sy base-devel openssl | |
steamos-readonly enable |
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 turtle | |
from collections import namedtuple | |
from math import sin | |
from random import choice, randint as ri | |
import time | |
WIDTH_BASE = [1, 10] | |
WIDTH_PERIOD = [1, 100] | |
WIDTH_AMP = [0, 20] |
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 droidhelper import DroidHelper | |
import socket | |
import struct | |
import time | |
SMOOTH = 2 | |
COEFF = 10000/20.0/SMOOTH | |
readings = [0] * SMOOTH | |
ind = 0 |
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 os | |
def cat(f): | |
return open(f).read() | |
def ls(): | |
return os.listdir('.') | |
def pwd(): | |
return os.getcwd() |
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
async def some_coroutine(): | |
await another_coroutine() | |
async def another_coroutine(): | |
pass |
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/env python3 | |
import wmi, time | |
def watch(): | |
c=wmi.WMI() | |
pss = c.query("select WorkingSetSize from win32_Process" | |
" where Name='chrome.exe'") | |
killed = [p.Terminate(0) for p in pss if int(p.WorkingSetSize) > 1800*1e6] |
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 | |
class DispatcherBase: | |
switch = 'what' | |
def __call__(self, act): | |
if not isinstance(act, dict): | |
act = json.loads(act) | |
what = act.pop(self.switch, None) |
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 os | |
import tkinter as tk | |
import random | |
from collections import namedtuple | |
WIDTH, HEIGHT = 300, 300 | |
PROG = WIDTH//10 | |
root = tk.Tk() | |
canvas = tk.Canvas(root, width=WIDTH, height=HEIGHT, bg='white') | |
img = tk.PhotoImage(width=WIDTH, height=HEIGHT) |
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
""" Thanks to http://speakrus.ru/dict/ """ | |
import random | |
f = open('pldf-win.txt', encoding='cp1251') | |
words = f.read().split('\n') | |
def gen(): | |
message = ' '.join(random.choice(words) for _ in range(random.randint(2, 6))) | |
message = message[0].upper()+message[1:] |
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
img = gimp.image_list()[0] | |
n = len(img.layers) | |
for i, l in enumerate(img.layers): | |
l.opacity = 100.0/(n-i) | |
NewerOlder