Skip to content

Instantly share code, notes, and snippets.

View jordanst3wart's full-sized avatar
🏠
Working from home

Jordan Stewart jordanst3wart

🏠
Working from home
View GitHub Profile
@jordanst3wart
jordanst3wart / dont.kt
Last active July 21, 2022 12:04
Kotlin personal don'ts
// carely use get, and set, it's good with extension functions with no arguements, allowing you to not have the extra "()"
val foo2: Int get() {
println("Calculating the answer")
return 42
}
// just use this
fun getInt(): Int {
[user]
name = fill me
email = [email protected]
[alias]
squash = "!f(){ git reset --soft $(git merge-base master $(git branch --show-current)) && git commit -m \"${1}\";};f"
update = "!f(){ git checkout master && git pull && git checkout $(git branch --show-current) && git rebase;};f"
[push]
autoSetupRemote = true
[pull]
@jordanst3wart
jordanst3wart / gist:20cf8041d19f0d2b7255d879fedafb25
Last active October 9, 2023 10:37
Typescript improvements
Typescript enums are bad, and unsafe
Typescript map key are compared by reference and not by value.
ie.
```
const map = new Map<any,string>()
map.set({},'hi')
map.set({},'hi2')
console.log(map.keys())
@jordanst3wart
jordanst3wart / golang-reading-list.md
Created January 5, 2024 02:30 — forked from 17twenty/golang-reading-list.md
17twenty / Nick's Golang Reading List
@jordanst3wart
jordanst3wart / gist:1cd5e43f32402a2b83d5f10b2cdc4f2d
Created February 26, 2024 23:52
Search google from the cli
#!/bin/bash
# add to .zshrc on mac
# assumes firefox developer edition installed
# uses $1 to search google
# works like `google "hi"`
google () {
open "/Applications/Firefox Developer Edition.app" "https://google.com.au/search?q=$1"
}
@jordanst3wart
jordanst3wart / crgb.cc
Created January 11, 2025 23:45 — forked from aditya-r-m/crgb.cc
Custom Trident Z DRAM RGB Turndown
// Pieces extracted & trimmed from https://gitlab.com/CalcProgrammer1/OpenRGB
// Basic usage : g++ crgb.cc -o ledoff && ./ledoff
// For turning off RAM LEDs at startup : compile in root home directory & add "@reboot /root/ledoff" to "sudo crontab -e"
#include <cstring>
#include <iostream>
#include <linux/i2c-dev.h>
#include <linux/i2c.h>
#include <sys/ioctl.h>