Skip to content

Instantly share code, notes, and snippets.

Sándor Kazi sandorkazi

  • Budapest
Block or report user

Report or block sandorkazi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View bgg_by_id.py
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium import common
from tqdm import tqdm
from urllib import request
import os
import random
import pandas as pd
import getpass
import sys
View artist2.py
with open('spotify_a_s.txt') as f:
songs = list(map(str.strip, f))
with open('spotify_a.txt') as f:
artists = list(map(str.strip, f))
def song_parser(songs, last_song=None, counter=0):
if songs == []:
if counter != 2:
yield (last_song, counter)
View ssh proxy
ssh -D {{proxyport}} -f -C -c aes256-ctr -q $@ sleep 10; firefox -P proxy{{proxyport}} &
View bgg-hun-gotw.py
import requests
from bs4 import BeautifulSoup
from time import sleep
URL_already = 'https://www.boardgamegeek.com/xmlapi/geeklist/213988'
URL_thumbsup = 'https://boardgamegeek.com/geekrecommend.php?action=recspy&itemtype=geeklist&itemid=213988'
URL_user = 'https://www.boardgamegeek.com/xmlapi2/user?name={}&domain=boardgame'
soup = BeautifulSoup(requests.get(URL_already).content, 'xml')
sleep(1)
@sandorkazi
sandorkazi / BGTradePicDownload.py
Last active Dec 9, 2018
BGTradePicDownload.py
View BGTradePicDownload.py
import requests as rq
import pandas as pd
from bs4 import BeautifulSoup
from tqdm import tqdm
page = rq.get('https://boardgamegeek.com/xmlapi2/collection?username=Masu&trade=1').content
soup = BeautifulSoup(page, 'xml')
df = pd.Series(list(map(lambda x: x.text, soup.findAll('image')))).to_frame('url')
df['title'] = pd.Series(list(map(lambda x: x.text.replace(' ', '').replace('!', '').replace(':', ''), soup.findAll('name'))))
@sandorkazi
sandorkazi / MRSimulator.py
Last active Feb 5, 2019
MapReduce simulator in python
View MRSimulator.py
from abc import abstractmethod
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor
from itertools import chain
import logging
import sys
from typing import Tuple, Any, Iterable, Union
class MRSimulator:
View pdfcrop.sh
#!/bin/bash
function usage () {
echo "Usage: `basename $0` [Options] <input.pdf> [<output.pdf>]"
echo
echo " * Removes white margins from every page in the file. (Default operation)"
echo " * Trims page edges by given amounts. (Alternative operation)"
echo
echo "If only <input.pdf> is given, it is overwritten with the cropped output."
echo
@sandorkazi
sandorkazi / .hs.sh
Last active Jul 8, 2018
bluetooth headset autoconfig
View .hs.sh
#!/bin/bash
ADDRESS=""
if [ "" != "${ADDRESS}" ]; then
echo ">>> RESTART bluetooth"
sudo systemctl restart bluetooth
sleep 2
echo -e "connect ${ADDRESS}\nexit\n" | bluetoothctl
sleep 4
View 1920.sh
#!/bin/bash
SETUP=$1
mode="1920x1080_60.00"
modestring="173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync"
lvds=LVDS1
vga=VGA1
function purge {
You can’t perform that action at this time.