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
# Code by GPT-4o | |
# data from: | |
# https://www.retrosheet.org/gamelogs/index.html | |
def parse_line_score(line_score): | |
# Initialize scores | |
visitor_score = 0 | |
home_score = 0 | |
# Split the line score by inning |
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
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks. | |
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/) | |
(() => { | |
const SHOW_SIDES = false; // color sides of DOM nodes? | |
const COLOR_SURFACE = true; // color tops of DOM nodes? | |
const COLOR_RANDOM = false; // randomise color? | |
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com) | |
const MAX_ROTATION = 180; // set to 360 to rotate all the way round | |
const THICKNESS = 20; // thickness of layers | |
const DISTANCE = 10000; // ¯\\_(ツ)_/¯ |
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 sys | |
import os | |
import click | |
import re | |
import time | |
import logging | |
logger = logging.getLogger(__name__) | |
def process_dir(f, depth=0, **av): |
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 asyncio | |
from yachalk import chalk | |
async def check_1(): | |
await asyncio.sleep(2) | |
return True, "all good man" | |
check_1.LABEL = "doing check 1" |
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 base64 | |
from cryptography.hazmat.backends import default_backend | |
from cryptography.hazmat.primitives.asymmetric import rsa | |
from cryptography.hazmat.primitives import serialization | |
from cryptography.hazmat.primitives import hashes | |
from cryptography.hazmat.primitives.asymmetric import padding | |
def utf8(s: bytes): | |
return str(s, 'utf-8') |
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
{ | |
"@context": [ | |
"https://www.w3.org/2018/credentials/v1", | |
"https://w3id.org/pathogen/v1", | |
"https://w3id.org/security/bbs/v1" | |
], | |
"id": "http://example.org/credentials/", | |
"type": [ | |
"VerifiableCredential" | |
], |
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
SELECT * | |
WHERE | |
{ | |
?id wdt:P31 wd:Q740752; | |
optional { ?id rdfs:label ?name } | |
optional { ?id wdt:P154 ?logo } | |
FILTER(lang(?name) = 'en') | |
} |
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
const unirest = require('unirest') | |
const query = ` | |
SELECT * | |
WHERE | |
{ | |
?id | |
rdf:type <http://schema.org/City>; | |
rdf:type ?type; | |
rdfs:label ?city; | |
dbo:country ?country. |
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
const _ = require("iotdb-helpers") | |
const Board = _size => { | |
const self = Object.assign({}) | |
let _d = {} | |
const _key = (x, y) => `${x}//${y}` | |
const _set = (d, x, y, v) => d[_key(x,y)] = v | |
const _get = (d, x, y) => d[_key(x,y)] || 0 |
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
-31 = ( 5 ) - ( 4 * 3 ) * ( 2 + 1 ) | |
( 5 ) - ( 4 ) * ( 3 ) * ( 2 + 1 ) | |
-23 = ( 5 ) - ( 4 ) * ( 3 * 2 + 1 ) | |
-21 = ( 5 - 4 * 3 ) * ( 2 + 1 ) | |
-20 = ( 5 - 4 * 3 * 2 - 1 ) | |
( 5 ) - ( 4 * 3 * 2 + 1 ) | |
( 5 - 4 * 3 * 2 ) - ( 1 ) | |
( 5 ) - ( 4 * 3 * 2 ) - ( 1 ) | |
( 5 ) - ( 4 ) * ( 3 * 2 ) - ( 1 ) | |
( 5 ) - ( 4 * 3 ) * ( 2 ) - ( 1 ) |
NewerOlder