Skip to content

Instantly share code, notes, and snippets.

import csv
import math
import gidgethub.httpx
import httpx
import trio
import asyncclick as click
STARGAZAERS = """query StargazersCount($owner: String!, $name: String!, $after: String = null)
{
from . import google
dispatch = {
'google': google.validate
}[platform](token)
def get_profile_for_token(client_ids, platform, token):
if platform == 'google' and platform in client_ids:
event is a custom object defined above
buttons = re.findall(r"text='([-\w ]*)'", event.stringify(), re.MULTILINE)
for number in buttons:
if number == " " or number == "View pokemon":
continue
last_request = functools.partial(event.click, text=number)
@altendky
altendky / ex.py
Last active June 6, 2018 14:57 — forked from AlecTaylor/ex.py
epoch2stat = {
key: val
for key, val in iteritems({
k: tuple(
(lambda stats: stats)(
tuple(imap(itemgetter(1), v))
)
)
for k, v in groupby(sorted(
imap(
# coding: utf-8
from datetime import datetime
from time import sleep
from psycopg2 import connect, OperationalError
connected = False
while not connected:
try:
@altendky
altendky / client.py
Last active April 21, 2018 20:51 — forked from riteshdroid/client output
neq_one
import requests
url='http://127.0.0.1:8090/blue'
hj=requests.post(url,{
"device":"TemperatureSensor",
"value":"20",
"timestamp":"25/01/2017 10:10:05"
})
@altendky
altendky / htmap_ui.py
Created April 9, 2018 18:27
ImageBrowser
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/Users/epi/Desktop/ImageBrowser/qtui/redox_ui.ui'
#
# Created by: PyQt5 UI code generator 5.10.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
@altendky
altendky / models.py
Last active December 22, 2017 17:56 — forked from RyanBreaker/models.py
class IdModel:
id = db.Column(db.Integer, primary_key=True)
class User(IdModel, UserMixin, db.Model):
username = db.Column(db.String(64), index=True, unique=True)
email = db.Column(db.String(128), index=True, unique=True)
password_hash = db.Column(db.String(128))
def __repr__(self):
@altendky
altendky / ok.py
Last active October 17, 2017 03:58 — forked from converge/ok.py
browser.find_element_by_xpath('//article/div[2]/section[2]/div/a').click()
try:
tmp_list = browser.find_element__by_tag_name('_6e4x5')
except NoSuchElementException:
tmp_list = browser.find_element_by_class_name('_3gwk6')
tmp_list = tmp_list.find_elements_by_tag_name('a')
def is_isogram(string):
string_lower = string.lower()
for i in string_lower:
if not i.isalpha():
continue
for n in range(string_lower.index(i) - 1,
string_lower.index(i) - len(string_lower), -1):
if string_lower[n] == i:
print("\"%s\" is not an isogram.") % (string)
return False