Skip to content

Instantly share code, notes, and snippets.

View Astroneko404's full-sized avatar
🎊
Wooo!

Astron Lagrange Astroneko404

🎊
Wooo!
View GitHub Profile
@Astroneko404
Astroneko404 / PCMRetrieveActor.cpp
Created March 21, 2023 07:19
Audio PCM Retrieving in Unreal Engine
// Fill out your copyright notice in the Description page of Project Settings.
#include "PCMRetrieveActor.h"
#include "EnvironmentQuery/EnvQueryTypes.h"
// Read PCM and save the data in a TArray
static void FilterCallback(
void* OBJ,
CriAtomExPlaybackId id,
@Astroneko404
Astroneko404 / hparams.py
Created February 15, 2023 10:21
tensorflow removed
# import tensorflow as tf
from text import symbols
class AttrDict(dict):
def __init__(self, *args, **kwargs):
super(AttrDict, self).__init__(*args, **kwargs)
self.__dict__ = self
def create_hparams(hparams_string=None, verbose=False):
"""Create model hyperparameters. Parse nondefault from given string."""
@Astroneko404
Astroneko404 / PytorchCNN.ipynb
Created September 24, 2022 02:42
CNN from scratch in PyTorch
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Astroneko404
Astroneko404 / PytorchLinearRegression.ipynb
Last active September 19, 2022 14:16
Linear regression (and logistic regression) in PyTorch from scratch
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Astroneko404
Astroneko404 / HammerspoonTrackball.lua
Last active September 8, 2022 12:06
[Archive] Use button4 & cursor to scroll (for my Logitech Trackman Marble)
-- HANDLE SCROLLING
local oldmousepos = {}
-- positive multiplier (== natural scrolling) makes mouse work like traditional scrollwheel
local scrollmult = 4
-- The were all events logged, when using `{"all"}`
mousetap = hs.eventtap.new({0,3,5,14,25,26,27}, function(e)
oldmousepos = hs.mouse.getAbsolutePosition()
local mods = hs.eventtap.checkKeyboardModifiers()
local pressedMouseButton = e:getProperty(hs.eventtap.event.properties['mouseEventButtonNumber'])
@Astroneko404
Astroneko404 / keycor.py
Last active January 12, 2024 06:53
Music key determination algorithm in Python using Krumhansl-Kessler weight, blog: https://astroneko404.github.io//Key-Determination/
from math import sqrt
from mido import MidiFile
MODE_TABLE = [
"C Major", "C Minor", "C# Major", "C# Minor", "D Major", "D Minor", "D# Major", "D# Minor", "E Major",
"E Minor", "F Major", "F Minor", "F# Major", "F# Minor", "G Major", "G Minor", "G# Major", "G# Minor",
"A Major", "A Minor", "A# Major", "A# Minor", "B Major", "B Minor"
]
# Weight arrays retrieved from music21
@Astroneko404
Astroneko404 / OpenUnityHub.bat
Last active July 25, 2022 07:28
Open UnityHub with Proxy
@echo off
set HTTP_PROXY=http://127.0.0.1:1088
set HTTPS_PROXY=http://127.0.0.1:1089
start "" "D:\Program Files\Unity Hub\Unity Hub.exe"
rem Check the version -> "C:\Program Files\Unity\Hub\Editor\2022.1.10f1"
@Astroneko404
Astroneko404 / publish-ghpages.md
Created June 11, 2021 10:51 — forked from tduarte/publish-ghpages.md
If you need to force push an subtree
git checkout master # you can avoid this line if you are in master...
git subtree split --prefix dist -b gh-pages # create a local gh-pages branch containing the splitted output folder
git push -f origin gh-pages:gh-pages # force the push of the gh-pages branch to the remote gh-pages branch at origin
git branch -D gh-pages # delete the local gh-pages because you will need it: ref
@Astroneko404
Astroneko404 / ChangeByte.sol
Last active January 31, 2021 15:48
Property tests of string variables in Solidity
pragma solidity >=0.7.0 <0.8.0;
contract ChangeByte {
bytes8 text = 'abcdefgh';
// 0x6162636465666768
function getText() public view returns(bytes8) {
return text;
}

Problem

A lot of GitHub projects need to have pretty math formulas in READMEs, wikis or other markdown pages. The desired approach would be to just write inline LaTeX-style formulas like this:

$e^{i \pi} = -1$

Unfortunately, GitHub does not support inline formulas. The issue is tracked here.

Investigation