Hello future self, here's the TypeScript version for your copy/pasting pleasure:
const delay = (ms: number) => new Promise(_ => setTimeout(_, ms))and your favorite JS version:
const delay = ms => new Promise(_ => setTimeout(_, ms))| import requests | |
| from datetime import datetime, timezone # <-- Add timezone here | |
| from packaging.version import parse as parse_version | |
| from packaging.specifiers import SpecifierSet | |
| import sys | |
| import time | |
| def get_latest_version_before_date(package_name, target_date_str, target_python_version_str=None): | |
| """ | |
| Fetches the latest version of a package available on PyPI before a target date, |
Hello future self, here's the TypeScript version for your copy/pasting pleasure:
const delay = (ms: number) => new Promise(_ => setTimeout(_, ms))and your favorite JS version:
const delay = ms => new Promise(_ => setTimeout(_, ms))| import { IncomingMessage, RequestListener, ServerResponse } from "http" | |
| import { createServer, Server } from "https" | |
| import puppeteer, { | |
| Browser, | |
| BrowserLaunchArgumentOptions, | |
| Protocol | |
| } from "puppeteer-core" | |
| import { Page } from "./types" | |
| import Cookie = Protocol.Network.Cookie |
| const chromiumVersion = (() => { | |
| const compare = (newVer = "", oldVer = "") => { | |
| const oldParts = oldVer.split("."); | |
| const newParts = newVer.split("."); | |
| for (let i = 0; i < newParts.length; i++) { | |
| const a = ~~newParts[i]; // parse int | |
| const b = ~~oldParts[i]; // parse int | |
| if (a > b) return 1; | |
| if (a < b) return -1; | |
| } |
XXX following for the popup with the users you're following to appear(async function(){
const UNFOLLOW_LIMIT = 800
const delay = (ms) => new Promise(_ => setTimeout(_, ms))
const findButton = (txt) => [...document.querySelectorAll("button").entries()].map(([pos, btn]) => btn).filter(btn => btn.innerHTML === txt)[0]| [data-darkreader-inline-bgcolor] { | |
| background-color: var(--darkreader-inline-bgcolor) !important; | |
| } | |
| [data-darkreader-inline-bgimage] { | |
| background-image: var(--darkreader-inline-bgimage) !important; | |
| } | |
| [data-darkreader-inline-border] { | |
| border-color: var(--darkreader-inline-border) !important; | |
| } | |
| [data-darkreader-inline-border-bottom] { |
| #!/usr/bin/env bash | |
| # Before: | |
| # (Assuming you standard branch is development in the mono repo) | |
| # git checkout -b add-services | |
| githubOrg=FOOBAR | |
| repoList="api backend-service frontend" | |
| repoBranch="development" | |
| serviceDir=services # local directory to pull the other repos in |
| --- | |
| kind: Role | |
| apiVersion: rbac.authorization.k8s.io/v1 | |
| metadata: | |
| namespace: default | |
| name: restart-pods | |
| rules: | |
| - apiGroups: | |
| - extensions | |
| - apps |
| /* | |
| bayesian rating = (v ÷ (v+m)) × R + (m ÷ (v+m)) × C | |
| where: | |
| R = stars for the entry | |
| v = number of votes for the entry | |
| m = minimum votes required to be listed (eg. 10) | |
| C = the mean stars across the whole list (eg. 4.1) | |
| This rating only includes entries that have at least 10 votes. | |
| The bayesian estimate is a statistical technique used to reduce the noise |
Prisma is amazing but unfortunately in it's early days and I got tired of having to manually enter my database info each time I ran prisma introspect.
With a little help of autoexpect this task is now automated.
Hint: On macOS you might need to install expect from brew, as the macOS version doesn't include autoexpect.
Modify script.exp to use your Postgres credentials.