Skip to content

Instantly share code, notes, and snippets.

@S1M0N38
S1M0N38 / proverbs.py
Last active September 15, 2018 00:42
wisdom dispenser 🧙‍♂️
# -*- coding: utf-8 -*-
import random
try:
from urllib.request import urlopen
except ImportError:
from urllib2 import urlopen
url = 'https://raw.githubusercontent.com/AntJanus/programmers-proverbs/master/README.md'
response = urlopen(url)
# API is not ready yet
import requests
token = 'put_token_here'
headers = {'Authorization': f'Token {token}'}
# events
url = 'https://againstallodds.me/api/events/england/premier_league/'
r = requests.get(url, headers=headers)
@S1M0N38
S1M0N38 / vpn.py
Last active May 30, 2018 20:24
CLI tool to connect to https://www.vpnbook.com
import argparse
import glob
import os
import subprocess
from bs4 import BeautifulSoup
import requests
import zipfile
BASE_URL = 'https://www.vpnbook.com/freevpn'
#!/bin/bash
# Change keyboard layout
sudo raspi-config
# Remove useless software
sudo apt-get remove --purge nodered -y
sudo apt-get remove --purge wolfram-engine -y
sudo apt-get remove --purge libreoffice* -y
sudo apt-get remove --purge scratch minecraft-pi -y
@S1M0N38
S1M0N38 / screen_grabber.py
Created April 25, 2017 08:09
MSS (written in pure python, working on windows, mac, linux) is capable to grab the screen at ~40 fps at 800x400 resolution.
import numpy as np
import cv2
import time
from mss import mss
from PIL import Image
'''Macbook have a bug about box's dimensions, can be just multiple of 16
but this bug will be fix soon in the next release'''
box = { "top": 10, "left": 10, "width": 400, "height": 320}