Skip to content

Instantly share code, notes, and snippets.

View DaelonSuzuka's full-sized avatar
💭
LFG

David Kincaid DaelonSuzuka

💭
LFG
View GitHub Profile
@t3dotgg
t3dotgg / try-catch.ts
Last active June 1, 2025 04:06
Theo's preferred way of handling try/catch in TypeScript
// Types for the result object with discriminated union
type Success<T> = {
data: T;
error: null;
};
type Failure<E> = {
data: null;
error: E;
};
@thatrand0mnpc
thatrand0mnpc / custom_traceback_example.py
Last active August 1, 2022 21:22
Python custom traceback
import linecache
import re
import sys
from types import TracebackType
from typing import Any, Dict, List, Optional
PACKAGE_PATH_PATTERN = r'.*/lib/python.*/site-packages/.*'
class TracebackLogger:
@opastorello
opastorello / sublime text 4143 license key
Last active May 31, 2025 14:08
sublime text 4143 license key
> * Go to [hexed.it](https://hexed.it/)
> * Click "Open File" and choose your sublime_text.exe **(DON'T FORGET TO BACKUP YOUR EXE FILE)**
> * Go to Search and in "Search for" put: 80 78 05 00 0F 94 C1
> * In Search Type select "Enable replace" and put: 80 78 05 00 0F 94 C1
> * Click "Find next" then "Replace"
> * Do the same thing with: C6 40 05 01 48 85 C9 => C6 40 05 01 48 85 C9
> * Click "Save as" then name it: sublime_text
> * Copy your modified sublime_text.exe to directory Sublime Text
@joepie91
joepie91 / es-modules-are-terrible-actually.md
Last active May 9, 2025 15:29
ES Modules are terrible, actually

ES Modules are terrible, actually

This post was adapted from an earlier Twitter thread.

It's incredible how many collective developer hours have been wasted on pushing through the turd that is ES Modules (often mistakenly called "ES6 Modules"). Causing a big ecosystem divide and massive tooling support issues, for... well, no reason, really. There are no actual advantages to it. At all.

It looks shiny and new and some libraries use it in their documentation without any explanation, so people assume that it's the new thing that must be used. And then I end up having to explain to them why, unlike CommonJS, it doesn't actually work everywhere yet, and may never do so. For example, you can't import ESM modules from a CommonJS file! (Update: I've released a module that works around this issue.)

And then there's Rollup, which apparently requires ESM to be u

@AlexFlasch
AlexFlasch / beholder.gd
Last active June 22, 2022 05:26
Watcher / Script Runner for EditorScripts in the Godot Engine
################################################################################
# Beholder: Simple watcher plugin #
################################################################################
# #
# ABOUT: #
# If you specify the directories you'd like watched, and the scripts you'd #
# like to be run, this plugin will run those EditorScripts any time file #
# names or file contents have changed, as well as when files are added or #
# removed in the specified subdirectories. #
# #
@onlurking
onlurking / programming-as-theory-building.md
Last active June 2, 2025 02:38
Programming as Theory Building - Peter Naur

Programming as Theory Building

Peter Naur

Peter Naur's classic 1985 essay "Programming as Theory Building" argues that a program is not its source code. A program is a shared mental construct (he uses the word theory) that lives in the minds of the people who work on it. If you lose the people, you lose the program. The code is merely a written representation of the program, and it's lossy, so you can't reconstruct

@lizthegrey
lizthegrey / attributes.rb
Last active May 23, 2025 05:50
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@WiliTest
WiliTest / some_google_doc_shortcuts_to_change_font_highlight.user.js
Last active March 26, 2024 10:34
some google doc shortcuts to change the font and highlights using a Userscript (works with ViolentMonkey)
// Help needed: I failed to send a value to the text resize and to apply it. Any idea ?
// to install this script: install the violentmonkey extension. Then click on "raw" on this github page.
// *perso note:
//to install or to send update:
// 1/ edit must be done on github (cf. the url in the tab settings).
// 2/ Edit/update the script (using the edit github button) + increase the version (or it will ask to reinstall in the next step)
// (don't need to increase the version if the change are just for myself: just reinstall it to keep the version)
// 3/ click on RAW (it will show the changes).
@EIREXE
EIREXE / Godot Minimap.md
Last active April 17, 2025 11:48
Automatic minimap generation in godot

Building an automated map/minimap system in Godot

Why?

Our game, ERO-ONE needed a minimap system, it being an open world game made this a necessity, otherwise the player wouldn't really know where he's going.

Of course making a proper minimap is hard, we told ourselves that our game didn't really need it because it's not as big as the open world powerhouse that is Grand Theft Auto, but the real reasons are...

@stevenliebregt
stevenliebregt / pyqt5-eventfilter-touch-example.py
Created June 15, 2018 14:52
PyQt5 Example of the eventFilter, and a TouchEvent capture.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from PyQt5.QtCore import QEvent
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWidgets import QMainWindow