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
#!/usr/bin/env python3 | |
# This Python script can quickly generate passwords. | |
# Simply type 'pwgen' into the terminal. | |
# Options: | |
# -l or --length to set the length. Default is 20. | |
# -a or --alphanumeric to generate an alphanumeric password: no special characters. | |
import argparse | |
import random |
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 { z } from "zod" | |
// USER | |
const userNameSchema = z | |
.string({ | |
invalid_type_error: "Username must be a string", | |
required_error: "Username is required", | |
}) | |
.min(2, { message: "Username must be at least 2 characters long" }) |
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 scriptProperties = PropertiesService.getScriptProperties() | |
const WEBHOOK_URL = scriptProperties.getProperty('WEBHOOK_URL') | |
const COLLEAGUES = [ | |
{ | |
name: 'Hanna', | |
slackID: '...', | |
}, | |
{ | |
name: 'Martin', |
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
""" | |
This module verifies that 1260 is the highest possible order of an element in the 3x3 Rubik's cube group. | |
This is only an upper bound but it turns out that it can also be achieved, so this estimate is precise. | |
The approach is loosely based on the answer by 'jmerry' at https://math.stackexchange.com/questions/2392906/ | |
""" | |
from functools import lru_cache | |
import math |
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 time | |
# This script generates numbered timestamps based on clicks | |
# This has been used for example in https://youtu.be/4t61xW8QIEg | |
def main(): | |
print("Click whenever you want to mark a timestamp") | |
print("Press 'q' to quit and generate timestamps\n") |
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
/* | |
This script needs to be bound with a Google Spreadsheet. | |
It needs to have a header row of the form: title | start | end | description | |
The script then generates calendar entries for every row below. | |
For example, the sheet could have the following entries (displayed in csv format): | |
Title,Start,End,Description | |
Test 1,27.02.2024 11:00:00,27.02.2024 15:00:00,Hallo 1 | |
Test 2,28.02.2024 15:00:00,28.02.2024 17:30:00,Hallo 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
const TOKEN = "...." // your github access token | |
const owner = "..." // your github name | |
const blackList = [] // the names of the repos you don't want to process | |
const { Octokit } = require("@octokit/rest") // install this first | |
const octokit = new Octokit({ auth: TOKEN }) | |
const fs = require("fs") |
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 loadmore_condition = (button) => button.innerText.includes('Load more'); | |
const status_element = document.createElement('div'); | |
status_element.innerText = 'Opening conversations ...'; | |
status_element.style = | |
'position: fixed; z-index: 100; top: 1rem; left: 1rem; background-color: white; color: black; border: 1px solid black; padding: 0.5rem 1rem;'; | |
document.body.appendChild(status_element); | |
async function open_conversations() { |
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
/* | |
This Google script needs to be added to a Google spreadsheet. | |
It lists all calendar entries within one year (that time range is configurable) | |
and adds them to the first sheet in the spreadsheet. The script also adds | |
a button 'Update' in the spreadsheet's UI that executes the main update function. | |
*/ | |
const spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); | |
const sheet = spreadsheet.getSheets()[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
type Tuple<Length extends number, T, Accumulator extends T[] = []> = | |
Accumulator["length"] extends Length ? | |
Accumulator : | |
Tuple<Length,T,[...Accumulator,T]>; | |
const example: Tuple<3,string> = ["hi","mom","!"]; |
NewerOlder