Skip to content

Instantly share code, notes, and snippets.

View paul-hansen's full-sized avatar

Paul Hansen paul-hansen

View GitHub Profile
@paul-hansen
paul-hansen / bevy_0_11_ast-grep.md
Last active September 26, 2023 22:27
Bevy 0.11 migration with ast-grep

Bevy 0.11 migration with ast-grep

Uses ast-grep to apply some parts of bevy 0.10 to 0.11 migration that can be automated.

You should review any changes this makes.

cargo install ast-grep
sg -p 'Clicked' --rewrite 'Pressed' -U
sg -p 'LAlt' --rewrite 'AltLeft' -U
@paul-hansen
paul-hansen / main.rs
Created December 2, 2022 22:17
Hangman rust game written by ChatGPT
/// Everthing below this comment block was generated by ChatGPT from the prompt:
/// "write a hangman game in the rust language without comments"
/// (with comments it was too long and cut off the end)
use std::collections::HashSet;
use std::io;
const MAX_GUESSES: i32 = 6;
fn main() {
println!("Enter a word for the other player to guess: ");
@paul-hansen
paul-hansen / UpArrowLongPressAsShift.ahk
Last active July 18, 2021 19:17
AutoHotKey script to treat a long press of the up arrow key as shift. Useful for laptops like the Razer Blade stealth 13 since the up arrow is where shift should be.
#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.
Up::
; Wait for time to see if it is still pressed
KeyWait, Up, T0.07
if (ErrorLevel){
; Still being pressed, treat as shift
Send {Shift Down}