Skip to content

Instantly share code, notes, and snippets.

@radiantly
radiantly / atomberg.yaml
Last active March 4, 2025 18:38
ESP32 ESPHome configuration for Atomberg fans (control via IR LED)
esphome:
name: atomberg
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active March 4, 2025 18:34
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

@HMilbradt
HMilbradt / index.html
Last active March 4, 2025 18:32
A simple pen drawing example using HTML canvas, completely from scratch. Created as part of my blog https://harrisonmilbradt.com/articles/canvas-line-drawing-explorations
<html>
<body>
<div class="relative">
<canvas width="500" height="500" id="canvas"></canvas>
<button id="blue-button">Blue</button>
<button id="red-button">Red</button>
<input type="range" id="pen-width" min="1" max="10" value="5" />
#! /usr/bin/perl
use v5.10;
use strict;
use warnings;
use Pod::Usage;
use Getopt::Long;
use POSIX 'dup2';
our $VERSION= 0.001;
@x0nu11byt3
x0nu11byt3 / elf_format_cheatsheet.md
Created February 27, 2021 05:26
ELF Format Cheatsheet

ELF Format Cheatsheet

Introduction

Executable and Linkable Format (ELF), is the default binary format on Linux-based systems.

ELF

Compilation

@justdave
justdave / kickstucklocks.sh
Created March 3, 2018 10:31
Zimbra 8.8.5 seems to freeze up on me periodically. I wrote this script to automatically kick it when it happens to avoid getting calls from users at odd hours complaining that they couldn't check their mail.
#!/bin/bash
# Script to automatically restart mailboxd when IMAP mailboxes fail to lock
# (which usually indicates the server has hung)
#
# Configure MAILTO to match where you want the notification email sent.
#
# Prerequisite: You must install LogWarn, which can be found at
# https://github.com/archiecobbs/logwarn if your package manager doesn't have
# it.
@nfunato
nfunato / life-rosetta.fth
Last active March 4, 2025 18:19
Conway's Game of Life in FORTH (essentially same with one in rosesttacode)
\ -*- Mode: Forth -*-
\ Conway's Game of Life
\ originally from http://rosettacode.org/wiki/Conway's_Game_of_Life#Forth
\ see also http://en.wikipedia.org/wiki/Conway's_Game_of_Life
\ -------------------------------------------------------------------
\ The fast wrapping requires dimensions that are powers of 2.
\ (for playing just size, you may set terminal size to 64x17)
@infoslack
infoslack / grpo_demo.py
Created January 27, 2025 17:59
Group Relative Policy Optimization (GRPO) implementation
# This implementation is based on the paper: https://github.com/deepseek-ai/DeepSeek-R1/blob/main/DeepSeek_R1.pdf
#
# pip install torch transformers
# python grpo_demo.py
import torch
import torch.nn as nn
import torch.optim as optim
from transformers import BertTokenizer, BertModel
@matthewzring
matthewzring / markdown-text-101.md
Last active March 4, 2025 18:06
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

What this guide covers:

@t3dotgg
t3dotgg / try-catch.ts
Last active March 4, 2025 18:06
Theo's preferred way of handling try/catch in TypeScript
// Types for the result object with discriminated union
type Success<T> = {
data: T;
error: null;
};
type Failure<E> = {
data: null;
error: E;
};