Skip to content

Instantly share code, notes, and snippets.

View na-2n's full-sized avatar

yui​ na-2n

View GitHub Profile
@na-2n
na-2n / mt.py
Last active April 1, 2024 20:19
masstag
"""
---------
Masstag
---------
Batch adds tags to all files in the current or specified directory
Filenames can be formatted as:
Show Name S01E01.mp3
Show Name - 01.mp3
[Group] Show Name - 1.mp3
@na-2n
na-2n / discogshide.js
Last active May 23, 2023 23:40
Userscript to hide users from discogs "have" lists
// ==UserScript==
// @name discogshide
// @namespace dicksogs
// @match *://*.discogs.com/release/stats/*
// @grant none
// @version 1.0
// @author yui
// @description Hides specified users from discogs "have" lists
// ==/UserScript==
// Licensed under LGPLv3, Copyright (c) 2020 Yui
using System;
namespace Blocc.Engine.Common
{
public class Array3D<T>
{
private readonly Memory<T> _mem;
private readonly int _width;
// Licensed under LGPLv3, Copyright (c) 2020 Yui
import { defineGlobals } from "./helpers";
export interface Star {
x: number;
y: number;
age: number;
maxAge: number;
}
@na-2n
na-2n / Image.cpp
Created April 10, 2020 09:29
OpenGL image loader
// Licensed under LGPLv3, Copyright (c) 2020 Yui Kerver
#include "Image.hpp"
#include <fstream>
namespace Engine
{
Image Image::Load(const std::string path)
{
#!/bin/env python
#
# Licensed under GPLv3, Copyright (c) 2020 Yui
#
import sys
import dbus
def cut_text_scrolling(text: str, offset: int, maxlen=20, sep=' :: ',
@na-2n
na-2n / error_wrapper.rs
Created March 22, 2020 19:43
useless rust error wrapper struct
use std::{
error::Error,
fmt::{self, Display},
};
macro_rules! wrap_err {
($err:expr) => {
ErrorWrapper::from($err)
};
}
#include <stddef.h>
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
bool validate_email(const char* str, size_t length)
{
if (!length) return false;
size_t at_sign_idx = 0;
// Licensed under GPLv3, Copyright (C) 2020 Yui
#ifndef __MIDI_EVENT_H__
#define __MIDI_EVENT_H__
#include <cstddef>
#include <cstdint>
#include <vector>
#include <functional>
// Licensed under GPLv3, Copyright (c) 2020 Yui
#ifndef __BUFINT_H__
#define __BUFINT_H__
#include <stdint.h>
#define BUFINT_UNION(bits) \
union int##bits##_buf_t \
{ \