Skip to content

Instantly share code, notes, and snippets.

View pybites's full-sized avatar

Pybites pybites

View GitHub Profile
@pybites
pybites / emailer.py
Created March 23, 2017 10:31 — forked from sarahholderness/emailer.py
Python scripts to read a list of customer emails and send an email with the daily weather forecast
import weather
import smtp
'''
Send a greeting email to our customer email list
with the daily weather forecast and schedule
'''
def get_emails():
# Reading emails from a file
@pybites
pybites / tictactoe.py
Last active August 19, 2020 09:59
A simple tictactoe game including AI
'''Simple tictactoe game, board positions are like keyboard
7 8 9
4 5 6
1 2 3
'''
from builtins import input
from collections import Counter
from functools import wraps
import itertools
@pybites
pybites / PyBites.py
Last active June 4, 2017 18:19 — forked from clamytoe/PyBites.py
PyBites.py
"""Written on iPhone with the Pythonista 3 app
As a joke for the PyBites guys, I don't see why it wouldn't work anywhere else though. They always
start off their newsletter annoucements with:
from @PyBites import newsletter
So I turned it into actual code that pulls their feed and opens their latest newsletter in a browser :)
"""
import webbrowser
@pybites
pybites / followers_wc.ipynb
Created August 20, 2017 22:41 — forked from simecek/followers_wc.ipynb
Generate wordcloud of followers' descriptions
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!python3
# my first VBA macro redone in Python
# related article: How I got fired up about programming
# https://bobbelderbos.com/2016/02/fired-up-about-programming/
# 1. download game here: http://juegosexcel.com/foro/viewtopic.php?t=6396
# 2. (to avoid loosing a lot of time using older excel libs) save file to xlsx
#
from collections import namedtuple
import re
@pybites
pybites / slack-community.py
Created April 22, 2018 04:53
script to get timezone distribution of our slack community
from collections import Counter
import os
import sys
from slackclient import SlackClient
token = os.environ.get('SLACK_TOKEN') or sys.exit('need slack api token')
client = SlackClient(token)
users = client.api_call("users.list")
timezones = Counter()
{"achievementPoints": 14565,
"battlegroup": "Cyclone",
"calcClass": "V",
"class": 9,
"faction": 0,
"gender": 0,
"lastModified": 1519011260000,
"level": 110,
"mounts": {"collected": [{"creatureId": 32158,
"icon": "ability_mount_drake_blue",
import os
# make venv and pip install selenium
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
# set your codechalleng.es username and password in venv/bin/activate, then source it
user = os.getenv('PB_USER')
password = os.getenv('PB_PW')
@pybites
pybites / amzlink.py
Last active December 17, 2020 15:21
import concurrent.futures
import os
import re
from timeit import timeit
import requests
URLS = 'urls'