Skip to content

Instantly share code, notes, and snippets.


Keaton Burleson 128keaton

View GitHub Profile
128keaton / chip-list-autocomplete-fix.directive.ts
Created Apr 14, 2021
Material Chip List Autocomplete Fix Directive
View chip-list-autocomplete-fix.directive.ts
import {AfterContentInit, ContentChild, Directive, QueryList, ViewContainerRef} from '@angular/core';
import {MatAutocompleteTrigger} from '@angular/material/autocomplete';
import {MatChip, MatChipList} from '@angular/material/chips';
* This directive fixes the Material Chip List Autocomplete issue where if you click an option in the autocomplete menu,
* the panel doesn't return unless you click out and click back in again.
* Keaton Burleson
128keaton /
Created Jan 28, 2021
Mac scripts for disabling nanny stuff, automating setup, etc.
# Disable the "Are you sure you want to open this application?" dialog
View led-tool
# vi /sbin/led-tool
# Shamelessly stolen from
if [ "$1" == "blue" ]; then
echo "Enabling steady blue LED"
echo 0 > /sys/class/leds/ubnt:white:dome/brightness
cat /sys/class/leds/ubnt:blue:dome/max_brightness > /sys/class/leds/ubnt:blue:dome/brightness
elif [ "$1" == "white" ]; then
echo "Enabling flashing white LED"
public static void iterateListData(ListNode listNode) {
ListNode currentList = listNode;
int nestLevel = 0;
while (currentList != null ){
StringBuilder nestIndicator = new StringBuilder("");
for (int i = 0; i < nestLevel; i++) {
System.out.println(nestIndicator + " data = " +;
128keaton /
Last active Nov 8, 2019
Small scripts I use to run IntelliJ IDEA inside of WSL2 with an X11 server

1. Create ramdisk in /etc/fstab:

Open up a shell instance editing /etc/fstab:

$ sudo nano /etc/fstab

Inside the editor, append the following to create a new ramdisk. Adjust the 1024M segment to whatever size you want your ramdisk to be.

tmpfs /tmp/ramdisk tmpfs noexec,defaults,noatime,size=1024M,x-gvfs-show,mode=1777 0 0
$(top -bn1 | grep load | awk '{printf"%.2f%%\t\t\n", $(NF-2)}')
128keaton /
Last active Sep 17, 2019
Prints HDD/Memory Usage (bash)
Memory Usage: [###############-------------------------] 38% (372M/962M, 194M available)
Disk Usage: [##########------------------------------] 26% (5G/19G, 13G available)
View RoundedThings.swift
class CentralMenuButton: UIButton {
var label: UILabel?
var labelText: String!
var labelColor: UIColor!
var labelFont: UIFont!
var labelAlignment: NSTextAlignment!
override init(frame: CGRect) {
128keaton / flashScreen.swift
Created Aug 29, 2019 — forked from bgreenlee/flashScreen.swift
Flashing the screen in Swift. Sticking this here because it took me a while to work out the right variable types and casting.
View flashScreen.swift
func flashScreen() {
let inDuration: CGDisplayFadeInterval = 0.0
let outDuration: CGDisplayFadeInterval = 1.0
let color = NSColor.white
var fadeToken: CGDisplayFadeReservationToken = 0
let colorToUse = color.usingColorSpaceName(NSColorSpaceName.calibratedRGB)!
let err = CGAcquireDisplayFadeReservation(inDuration + outDuration, &fadeToken)
if err != CGError.success {
View debug macos
Last login: Fri May 10 14:02:39 on ttys000
FusionDriveiMac:~ admin$ /usr/sbin/diskutil cs list -plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">