Skip to content

Instantly share code, notes, and snippets.

@AbePralle
AbePralle / MapCapsLock.ahk
Created October 22, 2022 06:22
AutoHotkey map [CAPS LOCK] to [CTRL] and [ESC]
; Install AHK: https://www.autohotkey.com
; Save this script somewhere
; File Explorer > type in: Startup
; Drag script shortcut into Startup folder
; Double-click to run
*CapsLock::
Send {Blind}{Ctrl Down}
cDown := A_TickCount
Return
@AbePralle
AbePralle / .vimrc
Created September 17, 2022 19:57
MacVim hlsearch+colors+syntax highlighting bug .vimrc
set hlsearch
colors darkblue "or any colorscheme
syntax on "or 'syntax enable'
@AbePralle
AbePralle / Component-based_Attributes.rogue
Last active December 24, 2020 06:20
Testing tree-based vs component-based attributes
uses Utility/Node
class ComponentObject
PROPERTIES
attributes : ComponentAttribute
METHODS
method init
method init( attribute:ComponentAttribute )
@AbePralle
AbePralle / IteratorEfficiencyTest.rogue
Created December 22, 2020 08:52
Testing has_another/read versus read_next
uses Bitmap
U5MapGen()
class U5MapGen
PROPERTIES
chunk_map = ...
"~~#############~" ...
"~##############~" ...
"###############~" ...
@AbePralle
AbePralle / 1-Test.rogue
Created July 27, 2020 22:11
Pseudorandom deterministic variations using X,Y coordinates
local random = [17,101,6,88,152,176,43,98,7,67,172,78,236,211,141,2,191,26,3,115,34,21,194,27,252,242,133,164,228,174,232,206,149,202,175,72,226,94,77,48,66,122,93,65,128,201,55,127,108,162,231,131,38,119,148,68,239,64,100,207,50,23,86,102,180,224,208,234,62,112,83,177,138,15,92,33,104,185,125,69,118,247,56,171,215,90,61,24,154,188,44,184,132,160,4,29,204,183,0,130,109,156,142,82,161,192,123,107,213,135,179,214,13,199,28,178,170,137,36,189,74,139,209,227,198,163,47,169,12,229,80,205,18,203,195,140,57,196,70,58,87,150,147,10,245,106,238,216,116,52,222,51,126,146,249,30,85,84,32,53,134,76,42,225,14,25,240,168,220,173,153,217,89,244,39,111,197,181,22,166,99,46,117,159,167,40,37,243,45,151,31,96,11,145,144,129,16,9,143,233,113,190,95,241,63,158,157,237,79,251,81,110,219,255,246,253,91,121,186,73,5,235,60,210,221,124,75,218,59,155,1,19,165,97,35,54,49,212,193,103,120,105,8,250,71,182,248,200,230,20,136,41,254,187,114,223]
local variations = 2
forEach (j in 1..60)
forEach (i in 1..80)
local index = random[ (
@AbePralle
AbePralle / Unpack.rogue
Created June 12, 2020 01:53
Unpack Rogue Class
class Point(x:Int32,y:Int32) [compound]
METHODS
method to->String
return "($,$)"(x,y)
endClass
$essential Boxed<<Point>>
class Alpha
PROPERTIES
@AbePralle
AbePralle / TempFile.rogue
Created May 29, 2020 09:57
Using 'use' to create temporary files
use file = TempFile("test")
trace file.filepath
local printer = file.print_writer
printer.println "Hello World!"
printer.close
endUse
class TempFile( base_name:String )
METHODS
method on_use->File
@AbePralle
AbePralle / Console.rogue
Last active May 20, 2020 20:32
Rogue ConsoleStyle
class ConsoleStyle
# USAGE
# println "$Hello World!$" (ConsoleStyle().fg_white.bg_red, ConsoleStyle().reset)
#
# OR
# ConsoleStyle.print( ConsoleStyle.FG_WHITE )
# ConsoleStyle.print( ConsoleStyle.BG_RED )
# print( "Hello World!" )
# ConsoleStyle.print( ConsoleStyle.RESET )
# println
@AbePralle
AbePralle / Cloner.rogue
Last active May 12, 2020 19:15
Rogue Metacode to fix specialized ThisType
#------------------------------------------------------------------------------
# Class Cloner
#------------------------------------------------------------------------------
class Cloner [singleton]
METHODS
method clone<<$Type>>( obj:$Type )->$Type
return $Type()
endClass
#------------------------------------------------------------------------------
@AbePralle
AbePralle / Cmd.rogue
Last active April 21, 2020 23:08
Cmd node example using new Node<<...>> convenience class
# More Complex Cmd node example with multimethod-style visitor
uses Utility/Node
class Cmd : Node<<Cmd>>
METHODS
method is_literal->Logical
return false
endClass
class CmdStatement : Cmd