Skip to content

Instantly share code, notes, and snippets.

View github-marketing-tools.py
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)
{
View gist:2390b459ae2ce853beae1a075f2c414b
altendky@p1:~$ mkdir tmp
mkdir: cannot create directory ‘tmp’: File exists
altendky@p1:~$ rm -rf tmp
altendky@p1:~$ mkdir tmp
altendky@p1:~$ cd tmp
altendky@p1:~/tmp$ git clone https://github.com/miurahr/aqtinstall
Cloning into 'aqtinstall'...
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (6/6), done.
View gist:46f3276dd809cdff47b0b31b77b0e2cc
~   master ●  python3.8 x.py
Traceback (most recent call last):
File "x.py", line 3, in <module>
import pylib.preferences as pref
ModuleNotFoundError: No module named 'pylib'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "x.py", line 7, in <module>
View oauth.py
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:
View gist:7a488870120ede4a6eccfd612d94b4df
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)
View x.py
def main_function(list_goes_here, deal_status): #This is the main search function in selenium. It will search for items in the browser
all_windows = driver.window_handles #and put successes into one bin, missing into another, and FUBAR ones into a third
for item in list_goes_here: #Use on the segmented list of old invoices first, then work procedurally through all cases
print(item)
holder = hyphen_split(item)
print(holder)
TLO_Bill_Num=holder[0]
TLO_Case_Num=holder[2]
TLO_IP_ID=holder[3]
View 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(
View untitled.ui
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Form</class>
<widget class="QWidget" name="Form">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>897</width>
<height>523</height>
View postgresql-sync.py
# coding: utf-8
from datetime import datetime
from time import sleep
from psycopg2 import connect, OperationalError
connected = False
while not connected:
try:
View client.py
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"
})
You can’t perform that action at this time.