Skip to content

Instantly share code, notes, and snippets.

View rudolfbyker's full-sized avatar
🌍
The grass withers, the flower falls, but the word of the Lord remains forever.

Rudolf Byker rudolfbyker

🌍
The grass withers, the flower falls, but the word of the Lord remains forever.
View GitHub Profile
@NodeJSmith
NodeJSmith / UnicodeEncodeError.md
Last active August 30, 2024 14:33
UnicodeEncodeError in Windows agent CI pipelines

Background

Running Python scripts in CI pipelines on Windows agents can sometimes cause UnicodeEncodeErrors that don't seem to make any sense. For example, running a simple command with a tool built in click or running dbx build or prefect build may run fine on your local Windows machine, but fail when running in a CI pipeline.

For example, running the below code:

# example.py
import click
@garretmh
garretmh / lib.es5.d.ts
Last active September 4, 2023 17:32
Proposed JSON type definition update
/** A parsed JSON value. */
export type json =
| string
| number
| boolean
| null
| json[]
| { [key: string]: json };
/** A JSON stringify-able value. */
@butla
butla / wait_for_tcp_port.py
Last active December 8, 2022 19:52
Waiting for a TCP port to start accepting connections (Python >=3.6)
"""
MIT License
Copyright (c) 2017 Michał Bultrowicz
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@JohnWeisz
JohnWeisz / assert.ts
Created January 29, 2017 11:06
TypeScript runtime checked type-assertion
export declare interface RuntimeAssert
{
any?: (value: any) => {
asNumber: () => number,
asArrayOfNumber: () => number[],
asString: () => string,
asArrayOfString: () => string[],
asBoolean: () => boolean,
asArrayOfBoolean: () => boolean[],
as: <T>(ctor: new (...args: any[]) => T) => T,
@kilhage
kilhage / nginx-gzip.conf
Created December 4, 2015 11:07
Enables gzip compression for common mime types in nginx
# most people include something like this. don't.
# check your default nginx.conf, it's already covered in a much better way.
#gzip_disable "MSIE [1-6]\.(?!.*SV1)";
# compress proxied requests too.
# it doesn't actually matter if the request is proxied, we still want it compressed.
gzip_proxied any;
# a pretty comprehensive list of content mime types that we want to compress
# there's a lot of repetition here because different applications might use different
@protrolium
protrolium / ffmpeg.md
Last active November 12, 2024 21:27
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

@ssokolow
ssokolow / raw_rip.sh
Last active December 18, 2022 00:44
Script for generating BIN/CUE pairs under Linux in a manner suitable for ripping Playstation games for emulation
#!/bin/bash
# NOTE: If the generated file contains audio tracks, they will have the wrong
# endianness for the .CUE file and something like BinChunker or my
# swab.py must be used to rewrite the .BIN file before it can be
# used. (This isn't automatic because swapping the byte order
# will break the .TOC file the .CUE was generated from)
#
# Required packages:
# - cdrdao (for the actual ripping and toc2cue)
# - eject (for closing and opening the tray)
@killercup
killercup / pandoc.css
Created July 3, 2013 11:31
Add this to your Pandoc HTML documents using `--css pandoc.css` to make them look more awesome. (Tested with Markdown and LaTeX.)
/*
* I add this to html files generated with pandoc.
*/
html {
font-size: 100%;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}