This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# %% | |
from pydantic import BaseModel | |
import re | |
import time | |
import asyncio | |
from mitmproxy import ctx | |
from mitmproxy.options import Options | |
from mitmproxy.tools.dump import DumpMaster | |
from selenium import webdriver | |
from selenium.webdriver.chrome.service import Service |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Fetch updates from remote | |
git fetch | |
# Loop over all branches except main | |
for branch in $(git branch | grep -v "main"); do | |
# Delete the branch | |
git branch -D $branch | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Any, Dict, Optional | |
import openai | |
import requests | |
from datetime import date, timedelta | |
API_BASE = "https://api.openai.com" | |
USAGE_ENDPOINT = f"{API_BASE}/dashboard/billing/usage" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import NewType | |
import timeit | |
UserID = NewType('UserID', int) | |
def check_on(user_id: UserID) -> int: | |
return user_id * 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import requests | |
from pyquery import PyQuery | |
import time | |
def send_to_pushover(): | |
requests.post("https://api.pushover.net/1/messages.json", data={ | |
"token": "XXX", | |
"user": "XXX", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tweepy | |
import json | |
import time | |
import datetime | |
from calendar import monthrange | |
from PIL import Image, ImageEnhance | |
import pathlib | |
import pylunar | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TWEETS = [ | |
"F3B383064F9A76AD777D08A4C3CBF4CD:DF4E827DCBA71AEA510F4B2BB5F62796:FDA3BA94D91870DA38783787178F6B565C391D441E82D1318571D0B1C17DC9B305C1B47EE8C69BF8F244027F53B1317DD53D8E27A923B3FE411411142754B846C53300483C5AA46A90D6F33F8F4BDF65F98D10C059A6A36D7F3C9A49472C768BAD275A094128D00860C5FD", | |
"6A9537BA898C70D3DB6BB5D984B6423104B5691111067413F6C3E9C6A3AB90678ADA2445592C41CA4802990621F47E21431125AE1E34B3A4C394CBD1AC4F1ACCC8FE04059C6586EF2425710619112CABF775C3C7CAE44DB8B6467228D845990295307A5539B3F8B50C735F4D4B2AEED59E73A5142F26578AA768FBBEF51B63BBF8AA824C2F87ED4C17E56C85", | |
"27F2322110C16594C3369792230F845F10E26231F76C201F164667C3CAD73FFA72AD710704BD3C3E65E91BDDF8888C8A7964F25510C29A598D21734BD1FD6FD5DB3D15F06E580A0C2839A81954BBDB3C690C9AB146792C02D3D976ECF57C1F37AB900A535F177E5A9CCAC190B2424BBF13B1F3D7F04C74DA593D43F058DF77DF4ACDC7F2A6FFC5847931AA74", | |
"FEA4845903FF9AFDF42A0C8CB25C0409A031EDC4BA3C05BC47298898CB5BECF2C02D0BAE7554", | |
"3CDB109B0AD9E30F845A0E07EE78FC83:ACC4B7820D28BF600134E74D00 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Came across the `randomLevel` function in | |
# | |
# https://github.com/automerge/automerge/blob/main/backend/skip_list.js | |
# | |
# which implements a geometric distribution with bit twiddling. | |
# | |
# Below is a pedagogical implementation. | |
import random | |
from collections import Counter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang:1.14.9-stretch | |
# See: https://docs.akash.network/validator-guides/gentxo | |
RUN cd $GOPATH/src && mkdir -p github.com/ovrclk && \ | |
cd github.com/ovrclk && \ | |
git clone https://github.com/ovrclk/akash.git && \ | |
cd akash && \ | |
MAINNET=true git checkout v0.8.1 && \ | |
make deps-install && \ | |
make install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Python 2.7.10 | |
usage: python [option] ... [-c cmd | -m mod | file | -] [arg] ... | |
Options and arguments (and corresponding environment variables): | |
-B : don't write .py[co] files on import; also PYTHONDONTWRITEBYTECODE=x | |
-c cmd : program passed in as string (terminates option list) | |
-d : debug output from parser; also PYTHONDEBUG=x | |
-E : ignore PYTHON* environment variables (such as PYTHONPATH) | |
-h : print this help message and exit (also --help) |
NewerOlder