Skip to content

Instantly share code, notes, and snippets.

View Gnimuc's full-sized avatar
🍤

Yupei Qi Gnimuc

🍤
  • Tokyo
  • 06:55 (UTC +09:00)
  • X @Gnimuc
View GitHub Profile
@bgolus
bgolus / InfiniteGrid.shader
Last active November 5, 2024 11:12
Infinite Grid shader with procedural grid with configurable divisions and major and minor lines markings.
Shader "Unlit/InfiniteGrid"
{
Properties
{
[Toggle] _WorldUV ("Use World Space UV", Float) = 1.0
_GridScale ("Grid Scale", Float) = 1.0
_GridBias ("Grid Bias", Float) = 0.5
_GridDiv ("Grid Divisions", Float) = 10.0
_BaseColor ("Base Color", Color) = (0,0,0,1)
_LineColor ("Line Color", Color) = (1,1,1,1)
@Gnimuc
Gnimuc / github-clear-notifications.py
Created June 20, 2023 11:41 — forked from airtower-luna/github-clear-notifications.py
Mark GitHub notifications as read
import json
import os
import requests
from datetime import datetime, timezone
NOTIFICATIONS = 'https://api.github.com/notifications'
token = os.environ['GH_TOKEN']
s = requests.Session()
s.headers.update({
@nmwsharp
nmwsharp / printarr
Last active August 15, 2024 01:43
Pretty print tables summarizing properties of tensor arrays in numpy, pytorch, jax, etc. --- now on pip: `pip install arrgh`
Pretty print tables summarizing properties of tensor arrays in numpy, pytorch, jax, etc.
Now on pip! `pip install arrgh` https://github.com/nmwsharp/arrgh
@oxinabox
oxinabox / isbits.jl
Created September 28, 2020 12:20
Decomposes til isbits
function print_isbits(f)
seen = Set()
MAX_ELE = 3
function print_isbits(fname, fval::FTYPE, indent) where FTYPE
ftext = "$fname - $FTYPE\n"
print(" "^indent)
fbits = isbitstype(FTYPE)
if fbits
using CImGui
using CImGui.GLFWBackend
using CImGui.OpenGLBackend
using CImGui.GLFWBackend.GLFW
using CImGui.OpenGLBackend.ModernGL
using AbstractPlotting
using GLMakie
import GLMakie: make_context_current, render_frame, to_native, Screen
# add ImGui rendering pass to GLMakie's rendering loop
@yig
yig / matrix derivatives.txt
Last active September 27, 2024 00:05
Matrix derivatives via Frobenius norm
Matrix derivatives via Frobenius norm
# Automatic matrix derivatives: http://www.matrixcalculus.org/
# A good primer on basic matrix calculus: https://atmos.washington.edu/~dennis/MatrixCalculus.pdf
# The Matrix Reference Manual: http://www.ee.ic.ac.uk/hp/staff/dmb/matrix/intro.html#Intro
# Trying to understand the derivative of the inverse: https://math.stackexchange.com/questions/1471825/derivative-of-the-inverse-of-a-matrix
# Derivative of the pseudoinverse:
https://math.stackexchange.com/questions/2179160/derivative-of-pseudoinverse-with-respect-to-original-matrix
https://mathoverflow.net/questions/25778/analytical-formula-for-numerical-derivative-of-the-matrix-pseudo-inverse
@shortjared
shortjared / list.txt
Last active November 15, 2024 11:42
List of AWS Service Principals
a4b.amazonaws.com
access-analyzer.amazonaws.com
account.amazonaws.com
acm-pca.amazonaws.com
acm.amazonaws.com
airflow-env.amazonaws.com
airflow.amazonaws.com
alexa-appkit.amazon.com
alexa-connectedhome.amazon.com
amazonmq.amazonaws.com
@thennequin
thennequin / PieMenu.cpp
Last active September 5, 2024 14:43
PieMenuAdv
struct PieMenuContext
{
static const int c_iMaxPieMenuStack = 8;
static const int c_iMaxPieItemCount = 12;
static const int c_iRadiusEmpty = 30;
static const int c_iRadiusMin = 30;
static const int c_iMinItemCount = 3;
static const int c_iMinItemCountPerLevel = 3;
struct PieMenu
@getzdan
getzdan / f6.jl
Created May 9, 2017 17:07
a quick method for generating grid of matrix subscripts
function f6(xs, ys)
lx, ly = length(xs), length(ys)
lxly = lx*ly
res = Array{Base.promote_eltype(xs, ys), 2}(lxly, 2)
ind = 1
while ind<=lxly
@inbounds for x in xs
res[ind] = x
ind += 1
end
@ocornut
ocornut / imgui_node_graph_test.cpp
Last active November 4, 2024 03:13
Node graph editor basic demo for ImGui
// Creating a node graph editor for Dear ImGui
// Quick sample, not production code!
// This is quick demo I crafted in a few hours in 2015 showcasing how to use Dear ImGui to create custom stuff,
// which ended up feeding a thread full of better experiments.
// See https://github.com/ocornut/imgui/issues/306 for details
// Fast forward to 2023, see e.g. https://github.com/ocornut/imgui/wiki/Useful-Extensions#node-editors
// Changelog
// - v0.05 (2023-03): fixed for renamed api: AddBezierCurve()->AddBezierCubic().