Skip to content

Instantly share code, notes, and snippets.

@LunarLambda
LunarLambda / git-eol.md
Last active February 19, 2025 22:45
Guide to line ending handling in Git

Guide to line ending handling in Git

Clickbait title: Improve your Git experience with this one weird trick StackOverflow hates

If you're reading this guide, it's because you're either wondering about, or have actively run into a problem with, Git's handling of line endings. Maybe you're a Windows user, or someone working on the same repository as you is, or you do development across operating systems, or you're working with tools that break operating system convention, or...

@jarcode-foss
jarcode-foss / bmp_icon.c
Created December 15, 2019 16:48
Assign _NET_WM_ICON cardinal and XWMHints pixmap for X11 window icons
/* BMP Image header */
struct __attribute__((packed)) bmp_header {
uint16_t header;
uint32_t size;
uint16_t reserved0, reserved1;
uint32_t offset;
/* BITMAPINFOHEADER */
uint32_t header_size, width, height;
uint16_t planes, bits_per_pixel;
uint32_t compression, image_size, hres, vres, colors, colors_used;
@WindowDump
WindowDump / thcrap_random.py
Last active June 16, 2019 15:59
thcrap patch configuration randomizer (Python 3.5+)
#!/usr/bin/env python3
# thcrap patch configuration randomizer by Window Dump, version 190430
# Changelog
# 190430
# * Added more patches to the default blacklist which probably corrupt your scorefiles
# 190314-2
# * Don't download files.js - it's managed by thcrap :nmlgcgod:
# * If patch.js had to be downloaded, keep it in memory
# 190314
//
// Author: Jonathan Blow
// Version: 1
// Date: 31 August, 2018
//
// This code is released under the MIT license, which you can find at
//
// https://opensource.org/licenses/MIT
//
//
@devinacker
devinacker / mmd.cpp
Last active June 23, 2023 06:57
.mmd to .mid converter
/*
MMD to MIDI (SMF) converter
(c) 2015 by Devin Acker <[email protected]>
No sysex, no tempo slides, but it loops Touhou music!
Licensed under WTFPL:
http://www.wtfpl.net/txt/copying/
*/
@MicahElliott
MicahElliott / colortrans.py
Created November 29, 2010 07:57
Convert values between RGB hex codes and xterm-256 color codes.
#! /usr/bin/env python
""" Convert values between RGB hex codes and xterm-256 color codes.
Nice long listing of all 256 colors and their codes. Useful for
developing console color themes, or even script output schemes.
Resources:
* http://en.wikipedia.org/wiki/8-bit_color
* http://en.wikipedia.org/wiki/ANSI_escape_code