Skip to content

Instantly share code, notes, and snippets.

View iacore's full-sized avatar

iacore

View GitHub Profile
@iacore
iacore / gist:dfc4beaeb0153dc127238ab1d9746af8
Created November 1, 2023 22:07
all pride flag colors
#000000
#0035A9
#004BFF
#00821B
#008F72
#00B8E7
#00D769
#023670
#052127
#060634
@iacore
iacore / main.c
Last active October 12, 2023 09:53 — forked from sogaiu/main.c
sh/exec-slurp via janet_dostring (assuming spork is installed)
// build:
//
// gcc -O0 -g main.c -I$HOME/.local/include -L$HOME/.local/lib -ljanet
// run:
//
// export LD_LIBRARY_PATH=$HOME/.local/lib
// ./a.out
#include "janet.h"
@iacore
iacore / alt-tab-fix.reg
Created August 10, 2023 09:15
Wine Registry File that fixes the game freezing when switching windows in X11
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Wine\X11 Driver]
"UseTakeFocus"="N"
@iacore
iacore / dotenv.zig
Created July 28, 2023 19:44
Zig dotenv
pub const EnvMap = struct {
arena: std.heap.ArenaAllocator,
pairs: std.ArrayList(Pair),
pub const Pair = struct {
k: []const u8,
v: []const u8,
};
@iacore
iacore / readability.go
Last active March 20, 2024 11:49
Readability: Turn web page into plain text and image (from yarr)
// Copyright 2017 Frédéric Guillot. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
package readability
import (
"bytes"
"errors"
"fmt"
@iacore
iacore / dinitctl.fish
Created June 25, 2023 09:49
dinitctl fish completion
# dinitctl
# Autogenerated from man page /usr/share/man/man8/dinitctl.8.gz
# Manually edited
set commands start stop status restart wake release unpin unload reload list shutdown add-dep rm-dep enable disable setenv
complete -f -c dinitctl -n "not __fish_seen_subcommand_from $commands" -l help -d 'Display brief help text and then exit'
complete -f -c dinitctl -n "not __fish_seen_subcommand_from $commands" -l version -d 'Display version and then exit'
complete -f -c dinitctl -n "not __fish_seen_subcommand_from $commands" -s s -l system -d 'Control the system init process (this is the default when run as root)'
complete -f -c dinitctl -n "not __fish_seen_subcommand_from $commands" -s u -l user -d 'Control the user init process (this is the default when not run as root)'
# (c) 04/11/2016, Rolf Rolles, Mobius Strip Reverse Engineering
import z3
import struct
# XOR key for src.bin
KEY_SECTOR = 0x37
# Counter position, as two words
CNTLO = 0
CNTHI = 0
import std/[cmdline, base64]
proc writePng(f: File; pngdata: string) =
let bytes = pngdata.encode
const CHUNK_SIZE = 4096
var remaining = bytes.len
var i = 0
while remaining > 0:
@iacore
iacore / mod.rs
Created March 30, 2023 05:50
opencolor for femtovg
pub use inner::*;
#[rustfmt::skip]
mod inner {
use femtovg::Color;
use lazy_static::lazy_static;
lazy_static!{ pub static ref WHITE: Color = Color::rgb(0xff, 0xff, 0xff); }
lazy_static!{ pub static ref BLACK: Color = Color::rgb(0x00, 0x00, 0x00); }
lazy_static!{ pub static ref GRAY_0: Color = Color::rgb(0xf8, 0xf9, 0xfa); }