Skip to content

Instantly share code, notes, and snippets.

@rbeesley
rbeesley / ansi-color.cmd
Last active July 10, 2022 20:20
Inspired by Daniel Crisman's BASH script from http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html. This file echoes a bunch of color codes to the terminal to demonstrate how they will render. The `Data Segment` portion of the file defines the table layout and allows the user to configure whatever matrix of ANSI Escape Sequence control characte…
@ECHO OFF & :: ANSI-COLOR :: Authored by Ryan Beesley :: https://github.com/rbeesley
GOTO :DEFINE_MACROS
%=- Entry point after macro definitions -=%
:MAIN
SETLOCAL ENABLEDELAYEDEXPANSION
CALL :PARSE_ARGS %1 %2 %3 %4 %5 %6 %7 %8 %9
:: Error when parsing
IF ERRORLEVEL 1 %@exit% %ERRORLEVEL%
:: Parsing success
@rbeesley
rbeesley / macos-install-nerd-fonts.ps1
Last active May 1, 2022 09:42
Installing Nerd Fonts
brew tap homebrew/cask-fonts
brew search nerd-font --cask | select -Skip 1 | %{ brew install $_ }
@rbeesley
rbeesley / NaturalScrolling.ps1
Last active November 8, 2021 23:32
Use the scroll wheel the way it was intended. Run as an Administrator. This configures all mice scroll wheels to use Natural Scrolling or Australian Scrolling. Instead of the mouse wheel controlling the scrollbar thumb, it relates to the content you're viewing. Up on the scroll wheel equates to scrolling the page up.
$mice = Get-PnpDevice | Where-Object {$_.FriendlyName -like "*mouse*"}
$updatedMice = @()
$ErrorActionPreference = "Stop"
foreach ($mouse in $mice) {
$mouseDeviceParametersPath = $(Join-Path $(Join-Path "HKLM:\SYSTEM\CurrentControlSet\Enum\" $mouse.InstanceId) "Device Parameters")
$mouseDeviceParameters = Get-ItemProperty $mouseDeviceParametersPath
$flipFlopWheel = $mouseDeviceParameters.FlipFlopWheel
@rbeesley
rbeesley / Install-CLJ.ps1
Created March 29, 2019 06:43
Use this to install the CLJ tool using a method like installing Chocolatey or Scoop, executing the remote script
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://download.clojure.org/install/win-install-1.10.0.442.ps1'))
@rbeesley
rbeesley / ants.clj
Last active August 29, 2015 14:07 — forked from michiakig/ants.clj
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Ant sim ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Copyright (c) Rich Hickey. All rights reserved.
; The use and distribution terms for this software are covered by the
; Common Public License 1.0 (http://opensource.org/licenses/cpl.php)
; which can be found in the file CPL.TXT at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by
; the terms of this license.
; You must not remove this notice, or any other, from this software.
;dimensions of square world