Skip to content

Instantly share code, notes, and snippets.

View gnat's full-sized avatar
:shipit:
ez pz lemon squeezy

Nathaniel Sabanski gnat

:shipit:
ez pz lemon squeezy
View GitHub Profile
@gnat
gnat / dhcp_ubuntu.md
Created February 10, 2025 23:49
Release Renew IP / DHCP on Ubuntu Kubuntu 24.04 24.10 25.04

Desktop? Can use the Networks GUI in the tray.

Ubuntu uses NetworkManager in 2025.

Refresh IP using NetworkManager:

  • nmcli connection show
    • Copy UUID.
  • nmcli connection down <UUID>
  • nmcli connection up <UUID>
@gnat
gnat / index.html
Last active August 24, 2024 22:13
<html>
<head>
<title>iOS test</title>
</head>
<body>
<thing>Yo</thing>
<thing_test>Yo</thing_test>
<thing_-test>Yo</thing_-test>
<_thing_test>Yo</_thing_test>
<-thing_test>Yo</-thing_test>

Programming Language Design

Do I need a tokenizer?

Many "languages" can get away without one, however, if your language has one of:

  • strings
  • comments
@gnat
gnat / flash_as2_vs_as3.md
Last active January 23, 2025 07:08
Why AS3 sucks and was a terrible direction for Flash (Actionscript 2 vs Actionscript 3)

Why AS3 was a terrible direction for Flash

https://www.youtube.com/watch?v=sGzulYJnTCo

tl;dr

  • Events were no longer cleaned up automatically in AS3. Remove a MovieClip, but the events would remain and continue listening / firing: major cause of project killing bugs and time wasters. AS2 cleaned up everything automatically.
  • Simple calls in AS2 are often blown up to multiple lines involving multiple objects in AS3. DX was not emergent anymore.
  • Too much complexity imposes copy/paste (or autocomplete) for experienced programmers.
    • Long term lowers maximum scripted functionality of app/game.
  • AS2 code was scoped 1:1 with what you could see.
@gnat
gnat / index.html
Last active July 7, 2024 01:55
3D Card (Surreal + CSS Scope Inline)
<html>
<head>
<script src="https://gnat.github.io/css-scope-inline/script.js"></script>
<script src="https://gnat.github.io/surreal/surreal.js"></script>
</head>
<body>
<style>
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; }
body { font-family: system-ui, sans-serif; perspective: 1500px; background: linear-gradient(#666, #222); }
@gnat
gnat / photoshop_linux.md
Last active September 17, 2023 10:25
Photoshop on Linux
  • Use Bottles flatpak.
  • Before Install
    • Menu ▶️ Runners ▶️ Get the latest GE Wine
  • Install
    • Custom ▶️ Select latest GE Wine
    • Click new bottle ▶️ Dependencies
      • atmlib
      • msxml3 msxml6
      • vcrun2008 vcrun2010 vcrun2012 vcrun2013
  • Expose directories to flatpak
@gnat
gnat / sublime_build_on_save.md
Last active September 12, 2023 08:35
Sublime Build on Save

Sublime Build on Save

Sublime in 2023 only has "Save on Build" not "Build on Save" built in.. use: https://github.com/alexnj/SublimeOnSaveBuild

Setting up a build.

  • Tools ➡️ Build System ➡️ New Build System...

run_on_save.sublime-build

{
@gnat
gnat / index.html
Last active September 9, 2023 07:28
Inline Stylus CSS demo
<html>
<head>
<title>Inline real time stylus demo</title>
<script>
function stylus_to_css(string){
var cursor=0
// Remove excess indentation (dedent).
var indent=''
while (cursor < string.length) {
@gnat
gnat / project_layout.md
Last active April 10, 2025 12:55
General Project Layout

Why a base project layout?

  • ⭐ Works for many different project types: game, website, app.
  • /main lets us have supporting files excluded from Caddy, Godot, etc with zero extra config!
  • ⭐ Avoids industry jargon.

Use ideas you like, leave ideas you dislike. The intention is to be simple adaptable starting point.

Project Layout

@gnat
gnat / godot.md
Last active October 30, 2024 08:56
Godot 4 Quickstart

Godot 4 Quickstart!

Legend

  • ♻️ Workflow
  • 🛠️ Tool
  • 📦 Asset or Library
  • ⭐ Guides
  • 🎨 Pattern
  • 🔥 Hot Tip