Skip to content

Instantly share code, notes, and snippets.

View kreeger's full-sized avatar

Ben Kreeger kreeger

View GitHub Profile
@kreeger
kreeger / Dockerfile
Last active May 21, 2024 17:23
Custom devcontainer dockerfile for Swift with swift-format.
ARG SWIFT_VERSION="5.10"
FROM swift:${SWIFT_VERSION}
ARG SWIFT_FORMAT_VERSION="510.1.0"
RUN git clone --depth 1 --branch $SWIFT_FORMAT_VERSION https://github.com/apple/swift-format.git &&\
cd swift-format &&\
swift build -c release &&\
mkdir -p /usr/local/bin &&\
mv .build/release/swift-format /usr/local/bin/swift-format
@kreeger
kreeger / keybase.md
Created April 12, 2024 21:10
keybase.md

Keybase proof

I hereby claim:

  • I am kreeger on github.
  • I am kreeger (https://keybase.io/kreeger) on keybase.
  • I have a public key ASBxFCo94gRaq0JkZxTj8gP3oDU_9-olK3p0qhwO9hogIwo

To claim this, I am signing this object:

@kreeger
kreeger / 000-steam-retroarch-on-deck.md
Last active December 19, 2023 18:51
Finds latest version of Steam Linux Runtime (sniper) and uses its library path to help run RetroArch, installed via Steam.

Running Steam-installed RetroArch on a Steam Deck

Script overview

This script lets you run Steam-installed RetroArch with command line arguments on a Linux-based system and lets you create separate Steam entries for each ROM, with a command like so (something like this should be in the "target" field):

"/path/to/where/Steam/installs/RetroArch/retroarch.sh" \
#!/usr/bin/env ruby
glob = ARGV[0] || '*.*'
Dir[glob].each do |f|
time = File.mtime(f)
File.utime(time, time, f)
end
@kreeger
kreeger / steam-big-picture-1080p.bat
Last active April 23, 2021 03:16
Two batch scripts for launching Steam in a specific resolution for streaming to a TV or iPad -- necessary to get the aspect ratio right if your primary PC display is not 16:9 or 16:10. Requires https://tools.taubenkorb.at/change-screen-resolution/
C:\Applications\ChangeScreenResolution.exe /w=1920 /h=1080 /d=0
"C:\Program Files (x86)\Steam\steam.exe" -start "steam://open/bigpicture"
TIMEOUT /T 3
C:\Applications\ChangeScreenResolution.exe /w=3440 /h=1440 /d=0
@kreeger
kreeger / Kreeger.3.0.binds
Created April 19, 2021 19:12
Elite Dangerous: Horizons keybinds (as of the Fleet Carrier update).
<?xml version="1.0" encoding="UTF-8" ?>
<Root PresetName="Kreeger" MajorVersion="3" MinorVersion="0">
<KeyboardLayout>en-US</KeyboardLayout>
<MouseXMode Value="" />
<MouseXDecay Value="0" />
<MouseYMode Value="" />
<MouseYDecay Value="0" />
<MouseReset>
<Primary Device="{NoDevice}" Key="" />
<Secondary Device="{NoDevice}" Key="" />
@kreeger
kreeger / Kreeger.4.0.binds
Last active April 19, 2021 19:11
Elite Dangerous: Odyssey keybinds (as of Alpha 3).
<?xml version="1.0" encoding="UTF-8" ?>
<Root PresetName="Kreeger" MajorVersion="4" MinorVersion="0">
<KeyboardLayout>en-US</KeyboardLayout>
<MouseXMode Value="" />
<MouseXDecay Value="0" />
<MouseYMode Value="" />
<MouseYDecay Value="0" />
<MouseReset>
<Primary Device="{NoDevice}" Key="" />
<Secondary Device="{NoDevice}" Key="" />
@kreeger
kreeger / kinto.py
Created August 2, 2020 02:47
My configuration for https://github.com/rbreaves/kinto (the default seems to switch Alt and Super/Cmd)
# -*- coding: utf-8 -*-
import re
from xkeysnail.transform import *
# Use the following for testing terminal keymaps
# terminals = [ "", ... ]
# xbindkeys -mk
terminals = ["gnome-terminal","konsole","io.elementary.terminal","terminator","sakura","guake","tilda","xterm","eterm","kitty","alacritty","mate-terminal","tilix","xfce4-terminal"]
terminals = [term.casefold() for term in terminals]
@kreeger
kreeger / HTTPRecording.swift
Created December 27, 2019 02:14
A convenient way to mock out URL requests in Swift tests.
//
// HTTPRecording.swift
//
import Foundation
struct HTTPRecording {
let statusCode: Int
let httpVersion: String
let headers: [String: String]
{"lastUpload":"2020-12-06T16:53:14.349Z","extensionVersion":"v3.4.3"}