Skip to content

Instantly share code, notes, and snippets.

@thejustinwalsh
thejustinwalsh / build.mjs
Created September 14, 2023 15:28
nodejs unreal plugin build script (macOS)
import { readFile, readdir } from 'fs/promises'
import { existsSync } from 'fs';
import { resolve, join, sep } from 'path'
import { argv } from 'process';
import { spawn } from 'child_process';
const exec = (
cmd,
args,
) => new Promise((resolve, reject) => {
@thejustinwalsh
thejustinwalsh / ParsecMacBindings.ahk
Created June 19, 2023 14:38
An attempt at AutoHotKey Mac keybinds for when remoting into a Windows box using Parsec from a Mac.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; You need to disable "Windows + X hotkeys" in the Group Policy Editor
; https://answers.microsoft.com/en-us/windows/forum/all/disable-windows-10-keyboard-shortcuts/8048c2bb-ceeb-4aa0-a3aa-e1ede2534209
; Media Keys
$F7::Send {Media_Prev}
@thejustinwalsh
thejustinwalsh / starship.toml
Created September 13, 2021 18:52
Starship Config
[aws]
symbol = " "
disabled = true
[cmake]
disabled = true
[conda]
symbol = " "
disabled = true
@thejustinwalsh
thejustinwalsh / git-secret-keybase.sh
Last active November 24, 2022 21:11
Using Keybase.io with git-secret
# install git secret (pick one)
brew install git-secret
sudo apt-get install git-secret
# Import keys into gpg from keybase
export GPG_TTY=$(tty) # Required for passphrase entry on WSL2 and MacOS
keybase pgp export | gpg --import
keybase pgp export --secret | bash -c "gpg --import --allow-secret-key-import"
# Import keys from user you wish to add
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/tjw/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
@thejustinwalsh
thejustinwalsh / FixedCustomTimeStep.cpp
Created June 4, 2020 00:19
UE4 FixedCustomTimeStep
#include "FixedCustomTimeStep.h"
bool UFixedCustomTimeStep::Initialize(UEngine* InEngine)
{
check(InEngine);
State = ECustomTimeStepSynchronizationState::Synchronized;
return true;
}
void UFixedCustomTimeStep::Shutdown(UEngine* InEngine)
@thejustinwalsh
thejustinwalsh / commands.sh
Created December 28, 2019 15:22
Commands I Commonly Forget
# Temporarily elevate permissions for perf to collect user space data
sudo sh -c 'echo 1 >/proc/sys/kernel/perf_event_paranoid'
@thejustinwalsh
thejustinwalsh / DebugInfo.hx
Created April 10, 2019 15:22
Heaps Debug Info UI
class DebugInfo extends h2d.Object
{
var sampleRate:Int;
var fpsText:h2d.Text;
var drawCallText:h2d.Text;
public function new(sampleRate:Int, parent:Null<h2d.Object>)
{
super(parent);
this.sampleRate = sampleRate;
@thejustinwalsh
thejustinwalsh / efx.c
Created March 30, 2019 21:54
EFX shim for OpenAL when using OpenAL without the EFX extension [iOS]
#include <hl.h>
void openal_al_get_auxiliary_effect_slotfv(int a, int b, vbyte* c) { }
float openal_al_get_auxiliary_effect_slotf(int a, int b) { return 0.f; }
void openal_al_get_auxiliary_effect_slotiv(int a, int b, vbyte* c) { }
int openal_al_get_auxiliary_effect_sloti(int a, int b) { return 0; }
void openal_al_auxiliary_effect_slotfv(int a, int b, vbyte* c) { }
void openal_al_auxiliary_effect_slotf(int a, int b, float c) { }
void openal_al_auxiliary_effect_slotiv(int a, int b, vbyte* c) { }
void openal_al_auxiliary_effect_sloti(int a, int b, int c) { }