Skip to content

Instantly share code, notes, and snippets.

View davidhaley's full-sized avatar

David Haley davidhaley

View GitHub Profile
@davidhaley
davidhaley / gist:c48cb5fbf6967305ad82eec343bbc506
Created October 10, 2024 21:54
perm error with /usr/bin/ls and cosmo pledge
FUN 53236 53236 793'592 448 InitExecve
FUN 53236 53236 802'092 464 call_once
FUN 53236 53236 803'791 496 SetupExecve
FUN 53236 53236 805'094 512 getenv
FUN 53236 53236 806'868 448 FindDebugBinaryCtor
FUN 53236 53236 808'271 464 call_once
FUN 53236 53236 809'509 496 FindDebugBinaryInit
FUN 53236 53236 810'843 576 issetugid
FUN 53236 53236 812'046 608 __getauxval
FUN 53236 53236 813'276 576 getenv
generated Sep 03, 2024 08:03:57
system "EndeavourOS Linux" Linux 6.10.6-arch1-1 x86_64
emacs 29.4 main 97ba0b12a EMACSDIR=~/.config/emacs/ EMACS=/usr/bin/emacs
doom 3.0.0-pre PROFILE=_@0 grafted, HEAD -> master, origin/master, origin/HEAD 5e78ed0 2024-07-07 14:39:50 -0400 ~/.config/doom/
shell /usr/bin/fish
features ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB
traits batch server-running envvar-file custom-file
modules :config use-package :completion (company +childframe) (vertico +icons) :ui doom doom-quit hl-todo (modeline +light) ophints (popup +defaults) (vc-gutter +pretty) vi-tilde-fringe window-select workspaces zen :editor (evil +everywhere) fold format multiple-cursors snippets :emacs dired (undo +tree) vc :checkers (syntax +childframe) (spell
@davidhaley
davidhaley / hers.sh
Created July 9, 2024 01:24 — forked from alganet/hers.sh
Fast and portable mouse/keyboard terminal capture (zsh,ksh,mksh,bash on Windows+WSL, Linux or Mac OS)
#!/bin/sh
# Quick run: bash -c "$(curl -L https://git.io/fjToH)"
# CTRL+W to exit
set -euf
unsetopt FLOW_CONTROL GLOB NO_MATCH NO_SH_WORD_SPLIT NO_PROMPT_SUBST 2>/dev/null || :
write ()
{
@davidhaley
davidhaley / mkv_to_mp4.sh
Created October 10, 2022 20:37
Convert all MKV files in the current directoy to MP4 (without re-encoding)
#!/bin/bash
for i in *.mkv; do
[ -f "$i" ] || break
OUTPUT="${i%.mkv}.mp4"
ffmpeg -i "$i" -c copy "$OUTPUT"
done
@davidhaley
davidhaley / config.rasi
Last active October 6, 2022 09:55
Rofi launcher config
# ~/.config/rofi/config.rasi
# repo: https://github.com/davatorium/rofi
# I found/modified this config from somewhere, but I forget where!
configuration {
display-drun: "Applications:";
display-window: "Windows:";
drun-display-format: "{name}";
font: "DM Mono Medium 10";
modi: "window,run,drun";
@davidhaley
davidhaley / gist:c4bc6a070c13523727fd10aae1c1e1c3
Last active October 9, 2022 03:14
LG C2 Enable 120hz (Nvidia) on login
# 1. Install nvidia-settings
$ pacman -Syu nvidia-settings
# 2. Run nvidia-settings
$ nvidia-settings
# 3. Set the correct refresh-rate in nvidia-settings (e.g. 120hz)
# X Server Display Configuration -> Set refresh-rate to desired, and Apply
# 4. Set the correct refresh-rate in Gnome
# Settings -> Display -> Set refresh-rate to match previous step
# 5. Verify Gnome's monitors settings are correct
$ code ~/.config/monitors.xml
# Common Settings
Home Button (Remote) -> Home Dashboard -> Gear Icon (Top Right) -> Edit Inputs -> Change input icon to PC (IMPORTANT for 4:4:4 Chroma - text clarity is atrocious without it)
General -> Always Ready -> Disabled
General -> AI Service -> Everything Disabled
General -> OLED Care -> Care Picture Settings -> Off
General -> OLED Care -> Device Self Care -> Energy Saving -> Energy Saving Step -> Off
General -> OLED Care -> Device Self Care -> Energy Saving -> Screen Off -> Off
General -> OLED Care -> OLED Panel Care -> Screen Move -> Off
General -> OLED Care -> OLED Panel Care -> Adjust Logo Brightness -> Off
General -> OLED Care -> OLED Panel Care -> Care Recommendations -> Off
@davidhaley
davidhaley / coin
Last active August 22, 2017 01:30 — forked from anonymous/coin
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Coin : MonoBehaviour
{
public GameObject coinPoof;
private static int coinsCollected = 0;
public int CoinsCollected
<!doctype html>
<html>
<head>Ajax Example</head>
<body>
<section>
<h1>Recent Posts</h1>
<article>
<h2>Post 1</h2>
<p>This is post1.</p>
</article>
"use strict";
$(document).ready(function() {
var form = document.forms[0];
var bet = document.getElementById("bet");
var guess = document.getElementById("guess");
var balance = 100;
var minBalance = 0;