Skip to content

Instantly share code, notes, and snippets.

View Desdaemon's full-sized avatar

Viet Dinh Desdaemon

View GitHub Profile
@Desdaemon
Desdaemon / Configure-Yumemiru.ps1
Last active May 12, 2025 02:25
Yume2kki sync scripts
# Stop on error
$ErrorActionPreference = "Stop"
if (-not (Get-Command rclone -ErrorAction SilentlyContinue)) {
if (-not (Get-Command winget -ErrorAction SilentlyContinue)) {
Write-Host "winget not found. Attempting to install App Installer..."
Start-Process "ms-windows-store://pdp/?ProductId=9NBLGGH4NNS1"
Write-Host ""
Write-Host "Please install 'App Installer' from the Microsoft Store."
@Desdaemon
Desdaemon / README.md
Last active October 23, 2024 13:59
WebGL shaders for ynoproject.net

YNO Shaders

Important

Migrated to Desdaemon/userscripts, this gist will no longer be updated!

Nope, not official, no matter how much you ask for it. This is a strictly client-side thing.

image Image courtesy of @zebraed

@Desdaemon
Desdaemon / Auto-Kalimba.js
Last active June 19, 2024 21:28
Collective Unconscious Auto Kalimba Sync
// ==UserScript==
// @name Collective Unconscious: Auto-Kalimba
// @namespace http://tampermonkey.net/
// @version 2024-06-09
// @description Play back MIDI files using the Kalimba!
// @author knuxify / unk_f000
// @license MIT
// @match https://ynoproject.net/unconscious/
// @icon https://www.google.com/s2/favicons?sz=64&domain=ynoproject.net
// @grant none
@Desdaemon
Desdaemon / lmusize.py
Last active July 5, 2024 05:30
Tool to read map width/height from RM2K LMU maps
#!/usr/bin/env python3
def read_map(path):
with open(path, 'rb') as file:
header = read_slice(file)
if header != b"LcfMapUnit":
return
width = None
height = None
while not (width and height):
@Desdaemon
Desdaemon / join.rs
Created July 11, 2023 19:24
typed-sled table joins
use std::{marker::PhantomData, sync::Arc};
use typed_sled::{Tree, KV};
#[derive(Clone)]
pub struct JoinTree<I, T> {
inner: I,
joins: T,
}
pub struct InnerJoin<T, F, FP>(T, F, PhantomData<fn(FP)>);
@Desdaemon
Desdaemon / gen-stub.py
Last active June 17, 2022 01:39
Create Python Stubs
#!/usr/bin/env python
# pyright: basic
import re
import sys
import os
import ast as a
from typing import Callable, Generic, Iterable, Iterator, TypeVar
from multiprocessing import Pool
from pathlib import Path
@Desdaemon
Desdaemon / api.rs
Created February 18, 2022 00:51
Long-running StreamSink
use anyhow::Result;
use std::{thread::sleep, time::Duration};
use flutter_rust_bridge::StreamSink;
const ONE_SECOND: Duration = Duration::from_secs(1);
// can't omit the return type yet, this is a bug
pub fn tick(sink: StreamSink<i32>) -> Result<()> {
let mut ticks = 0;
@Desdaemon
Desdaemon / init.lua
Last active February 1, 2022 03:11
NVIM config file
-- Full list at https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
local servers = {
'pyright', 'rust_analyzer', 'tsserver', 'dartls', 'clangd',
-- Provided by vscode-langservers-extracted
'html', 'eslint', 'cssls', 'jsonls',
}
local use = require('packer').use
require('packer').startup(function()
use 'wbthomason/packer.nvim' -- Self-management
#!/usr/bin/python3
# Source: https://support.particle.io/hc/en-us/articles/360045547634-How-can-I-set-up-my-Argon-or-Boron-via-USB-
from shutil import which
from urllib.request import urlopen
from sys import exit as bail
from subprocess import run
from os import remove
from re import compile as regex
@Desdaemon
Desdaemon / Ayu Dark.tmTheme
Created January 9, 2022 22:30
Ayu Dark TextMate color scheme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!-- Generated by: TmTheme-Editor -->
<!-- ============================================ -->
<!-- app: http://tmtheme-editor.herokuapp.com -->
<!-- code: https://github.com/aziz/tmTheme-Editor -->
<plist version="1.0">
<dict>
<key>name</key>
<string>Ayu Dark</string>