This file contains 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
// https://help.braiins.com/en/support/solutions/articles/77000433512-api-configuration-guide | |
type HashRateUnit = "Gh/s" | "Th/s" | "Ph/s"; | |
const _sampleStatsResponse: GeneralPoolStatsResponse = { | |
btc: { | |
luck_b10: "0.77", | |
luck_b50: "0.85", | |
luck_b250: "0.93", | |
hash_rate_unit: "Gh/s", |
This file contains 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
sudo mount -t drvfs 'G:\\' -o 'uid=1000;gid=1000;metadata;symlinkroot=/mnt/,mmap,access=client,msize=262144,trans=virtio,rw,noatime,dirsync,aname=drvfs' /mnt/g |
This file contains 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
#! /usr/bin/env bash | |
set -eu | |
city=helsinki | |
for type in restaurant sport culture; do | |
for page in {0..5000}; do # limit to 5000 queries on failure. | |
url="https://search.edenred.fi/affiliates?page=${page}&count=30&city=${city}&type=${type}" | |
file=edenred_${type}_${city}_page_${page}.json | |
curl -fL "$url" > "$file" |
This file contains 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 sys | |
from xml.sax.saxutils import escape | |
import winrt.windows.ui.notifications as notifications | |
import winrt.windows.data.xml.dom as dom | |
from winrt.windows.ui.notifications import ToastNotificationManager, ToastNotification, ToastTemplateType | |
if not sys.argv[2:]: | |
print(f'Usage: {sys.argv[0]} <title> <message ...>') | |
sys.exit(1) |
This file contains 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
--[[ Usage | |
Windows: | |
lua factorio-recipe-parser.lua "C:/Apps/Factorio/data/base/prototypes/recipe/" | |
Steam on macOS: | |
lua factorio-recipe-parser.lua ~/"Library/Application Support/Steam/steamapps/common/Factorio/factorio.app/Contents/" | |
NB: json.lua is from https://gist.github.com/tylerneylon/59f4bcf316be525b30ab | |
]]-- |
This file contains 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 List, Optional, Union | |
from dataclasses import dataclass | |
@dataclass | |
class CallbackGame: pass # Placeholder - zero fields in API doc | |
InputMessageContent = Union[ | |
'InputTextMessageContent', | |
'InputLocationMessageContent', |
This file contains 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
#! /usr/bin/env python3 | |
# Usage: dump_ryver_forum.py <PHPSESSID> <forum name, like "foo.ryver.com"> <forum ids, e.g. 1217356 ...> | |
# Requires Python 3.6 and the `requests` library: | |
# pip install requests | |
import requests | |
import sys | |
import time | |
session_id = sys.argv[1] | |
forum_name = sys.argv[2] |
This file contains 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
#!/usr/bin/env python | |
# ppxml - pretty print XML from stdin or argv files | |
# | |
# NB: if multiple XML files are specifies, concatenates the prettyprinted | |
# versions one after the other. | |
# | |
# Python 2 and Python 3 compatible AFAICT. | |
# | |
import sys | |
import xml.dom.minidom as md |
This file contains 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 http.server | |
import socketserver | |
import os, sys, re, glob, shutil | |
from pathlib import * | |
PORT = int(sys.argv[1]) | |
def get_known(): | |
try: | |
known_bad = list({x.strip() for x in open('known_bad.txt').read().strip().split('\n')}) |
This file contains 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 os, glob, sys | |
import time | |
from selenium import webdriver | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.common.keys import Keys | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.support.expected_conditions import presence_of_element_located | |
from selenium.webdriver.support import expected_conditions as EC | |
NewerOlder