Skip to content

Instantly share code, notes, and snippets.

@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active April 16, 2024 12:32
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@AgentOak
AgentOak / youtube_formats.md
Last active April 13, 2024 18:48
Youtube Format IDs

Last updated: April 2021

Also known as itag or format codes and way back they could be specified with the fmt parameter (e.g. &fmt=22). Depending on the age and/or popularity of the video, not all formats will be available.

DASH video

Resolution AV1 HFR High AV1 HFR AV1 VP9.2 HDR HFR VP9 HFR VP9 H.264 HFR H.264
MP4 MP4 MP4 WebM WebM WebM MP4 MP4
@joostrijneveld
joostrijneveld / gpg2qrcodes.sh
Created May 20, 2014 19:43
Producing printable QR codes for persistent storage of GPG private keys
# Heavily depends on:
# libqrencode (fukuchi.org/works/qrencode/)
# paperkey (jabberwocky.com/software/paperkey/)
# zbar (zbar.sourceforge.net)
# Producing the QR codes:
# Split over 4 codes to ensure the data per image is not too large.
gpg --export-secret-key KEYIDGOESHERE | paperkey --output-type raw | base64 > temp
split temp -n 4 IMG
for f in IMG*; do cat $f | qrencode -o $f.png; done
@pn11
pn11 / pmset.md
Last active December 19, 2019 14:36
Macbook の電源管理、または pmset コマンドの使い方

Macbook の電源管理、または pmset コマンドの使い方

pmset

pm は power management のことだと思われる。Yosemite までは、System Preferences->Energy Saver から、スリープまでの時間とディスプレイオフまでの時間を別に設定できたのだが、El Capitan ではコンピューターのスリープの時間が設定できなくなり、恐らくディスプレイのオフの時間と一緒になっている。これだとディスプレイだけオフしてバッテリーを節約したいけど、起動に時間のかかるスリープはして欲しくないという使い方ができない。 (一番下に比較画像を載せた)

pmset コマンドを使えばこれを設定できる。

pmset -g
@taqpan
taqpan / Raw-IR-Receiver.ino
Created August 19, 2012 10:11
Raw IR-signal receiver for Arduino with PL-IRM-2161-C438
#define PIN_IR_IN 8
#define SIGNAL_TIMEOUT 8000
#define DATA_LEN 512
short buf[DATA_LEN];
void clearBuf(int range)
{
for (int i = 0; i < range; i++)
buf[i] = 0;
@taqpan
taqpan / IR-sender.ino
Created July 12, 2014 17:31
IR-signal sender for Arduino
#define PIN_IR_OUT 4
#define PIN_LED_OUT 2
#define SIGNAL_LEN 7
// AEHA format
#define SIGNAL_LEADER_HIGH_TIME 3200
#define SIGNAL_LEADER_LOW_TIME 1600
#define SIGNAL_ON_HIGH_TIME 400
#define SIGNAL_ON_LOW_TIME 1200
#define SIGNAL_OFF_HIGH_TIME 400