Skip to content

Instantly share code, notes, and snippets.

View Xevion's full-sized avatar
⚜️
Chaos Order

Xevion Xevion

⚜️
Chaos Order
View GitHub Profile
{
"Response": {
"status": 200,
"flightInfo": {
"logo": null,
"airlineName": null,
"airlineCode": "ASA",
"airlineCodeIata": null,
"tailNumber": "N976AK",
"flightNumberInfo": "ASA541",
Error detected while processing WinEnter Autocommands for "*":
E5108: Error executing lua Vim:E495: no autocommand file name to substitute for "<afile>"
stack traceback:
[C]: in function 'expand'
[string ":lua"]:1: in main chunk
@Xevion
Xevion / dist.py
Created September 27, 2023 21:36
def score(distribution):
count = len(distribution)
deviation = [abs(1 / count - d) for d in distribution]
avg_deviation = sum(deviation) / count
return 1 - sum(deviation) / count
print(score([1 / 5 for _ in range(5)]))
print(score([0.12, 0.33, 0.55]))
@Xevion
Xevion / gist.sh
Last active September 26, 2023 20:09
❯ type -a pkg-config
pkg-config is /home/linuxbrew/.linuxbrew/bin/pkg-config
pkg-config is /usr/bin/pkg-config
pkg-config is /bin/pkg-config
❯ pkg-config --variable pc_path pkg-config
/home/linuxbrew/.linuxbrew/lib/pkgconfig:/home/linuxbrew/.linuxbrew/share/pkgconfig:/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/os/linux/pkgconfig
warning: variable does not need to be mutable
--> src/item.rs:412:15
|
412 | if let Ok(mut asleep) = (&mut asleeps).try_get(who) {
| ----^^^^^^
| |
| help: remove this `mut`
|
= note: `#[warn(unused_mut)]` on by default
use std::env;
use std::fs::File;
use std::io::{BufRead, BufReader, BufWriter, Write};
use std::path::Path;
use regex::Regex;
use chrono::{FixedOffset};
const HOUR: u32 = 3600;
fn parse_offset(raw_offset: &str) -> i32 {
use std::env;
use std::fs::File;
use std::io::{BufRead, BufReader, BufWriter, Write};
use std::path::Path;
use regex::Regex;
use chrono::{FixedOffset};
const HOUR: u32 = 3600;
fn parse_offset(raw_offset: &str) -> i32 {
adject = ['adult human', 'AFAB', 'alpha', 'AMAB', 'anime', 'biological', 'butch', 'cisgender', 'ex', 'failed', 'female', 'FtM', 'gamer', 'gay', 'gender neutral', 'it/its', 'male', 'MtF', 'neurodivergent', 'normal', 'non-binary', 'pathetic', 'punished', 'sigma', 'they/them', 'transgender', 'transsexual']
prefix = [ 'a', 'allo', 'andro', 'bi', 'boy', 'cat', 'cis', 'demi', 'dog', 'doll', 'fem', 'fluid', 'gender', 'girl', 'grey-a', 'guy', 'hetero', 'homo', 'him', 'inter', 'intra', 'les', 'lesbo', 'male', 'man', 'masc', 'macro', 'meta', 'micro', 'neo', 'neutro', 'non', 'nu', 'pan', 'poly', 'post', 'pre', 'she', 't', 'tom', 'trans', 'them', 'tri', 'x-', 'xirl'];
suffix = ['bian', 'binary', 'bo', 'boi', 'boy', 'butch', 'bxy', 'by', 'cat', 'dog', 'doll', 'fem', 'femme', 'friend', 'flux', 'fucky', 'gal', 'gender', 'girl', 'guy', 'gxrl', 'gyne', 'husband', 'lesbian', 'masc', 'male', 'man', 'moder', 'queer', 'sex', 'vir', 'wife', 'witch', 'woman', 'xirl'];
flags = {
nonbinary: ['#fcf434', '#fcfcfc', '#9c59d1', '#2c2
from datetime import datetime, timedelta
def get_start_of_week(value: datetime) -> datetime:
"""Returns the datetime of the start of the week for the given datetime."""
return (value - timedelta(days=value.weekday())).replace(hour=0, minute=0, second=0, microsecond=0)
def get_minutes_since_start_of_week(value: datetime) -> float:
"""Returns the number of minutes since the start of the week."""
{
"compilerOptions": {
"target": "es2020",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,