Skip to content

Instantly share code, notes, and snippets.

View McbeEringi's full-sized avatar
:octocat:
ニャーン

McbeEringi McbeEringi

:octocat:
ニャーン
View GitHub Profile
{
"trade_list_item":{
"type":"stack_panel","orientation":"horizontal",
"size":[16,16],
"controls":[
{"item_renderer@common.item_renderer":{
"layer":1,
"bindings":[
{"binding_type":"collection_details"},
{"binding_name":"#item_id_aux"},{"binding_name":"#item_custom_color"},{"binding_name":"#item_pickup_time"},
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32]
@=""
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\7-Zip.001\shell\open\command]
@="\"C:\\Users\\mcbe_eringi\\scoop\\apps\\7zip\\current\\7zG.exe\" x \"%1\""
[HKEY_CLASSES_ROOT\7-Zip.7z\shell\open\command]
@="\"C:\\Users\\mcbe_eringi\\scoop\\apps\\7zip\\current\\7zG.exe\" x \"%1\""
[HKEY_CLASSES_ROOT\7-Zip.arj\shell\open\command]
@="\"C:\\Users\\mcbe_eringi\\scoop\\apps\\7zip\\current\\7zG.exe\" x \"%1\""
@McbeEringi
McbeEringi / matter-js_spriter.js
Created March 7, 2022 07:06
matter-js simple sprite editor API
/*
SPEC
Spriter.textures: Array
texture cache
Spriter.mods: Array
modifier cache
Spriter.stdMod: Function((ctx,img)=>ctx.drawImage(img,0,0)) => void
default texture modifier
see also Spriter.setMod
ctx: CanvasRenderingContext2D
@McbeEringi
McbeEringi / matter-js_float-pixelRatio.js
Created March 7, 2022 06:27
matter-js pixelRatio bug fix patch
const FloatPR={
name:'float-pixelRatio',version:'0.1.0',for:'matter-js@*',
install(base){base.after('Mouse.create',function(){this.pixelRatio=+this.element.getAttribute('data-pixel-ratio')||1;});}
};Matter.Plugin.register(FloatPR);
@McbeEringi
McbeEringi / dec.glsl
Last active October 16, 2021 13:26
decimal display for utility shader
/*
precision mediump float;
uniform float time;
uniform vec2 res;
void main(){
vec2 p=gl_FragCoord.xy/res;
p*=7.;
float a=31.;
float b=21.;
float c=31.;
((e=document.documentElement,size=.5,c=document.createElement('canvas'))=>{
const ctx=c.getContext('2d'),
pre=x=>x.childNodes.forEach(y=>{
if(!y.tagName&&(y.textContent||'').trim()){
const el=document.createElement('span');
el.insertAdjacentHTML('beforeend',`<span>${y.textContent.replace(/</g,'>').replace(/([\n\r\s\t]+)/g,'</span>$1<span>')}</span>`.replace(/<span><\/span>/g,''));
y.parentNode.replaceChild(el,y);
}else pre(y);
}),
core=x=>{
@McbeEringi
McbeEringi / TC.js
Last active August 1, 2022 07:39
Scriptable.app sky:CotL
const cfx=t=>{
let s=[Math.floor((t.getTime()-new Date('2020/11/4 00:00').getTime())/864e5)%5];
s[1]=Math.floor((t.getDate()-1)/5)%[3,3,2,3,2][s[0]];
return s.join('');
},
ofx=t=>['Doom','Worker','Pizza','Vase','Cat','Space','Stroll'][(t.getDate()-1)%7];
let t=new Date();
const y=t.getFullYear(),dt=t.getTimezoneOffset()*6e4;
t=new Date(Date.now()+dt-8*36e5);
@McbeEringi
McbeEringi / grass.js
Last active December 14, 2023 11:44
Scriptable.app widget
const
d=await new Request(`https://github.com/users/${args.widgetParameter||'mcbeeringi'}/contributions`).loadString(),
grass=d.match(/data-date="\d{4}-\d{2}-\d{2}" .*? data-level="\d/g).map(x=>({valueOf:_=>+new Date(x.slice(11,21)),toString:_=>+x.slice(-1)})).sort((a,b)=>a-b),
total=+d.match(/[\d,]+$/m)[0].replace(/,/g,''),
user=d.match(/data-url="\/(.*?)"/)[1],
ico=await new Request(`https://avatars.githubusercontent.com/u/${d.match(/user_id&quot;:(\d*),/)[1]}`).loadImage(),
wfam=config.widgetFamily||'accessoryRectangular',
cfg={
draw:{
res:64,box:48,r:16,
{
"name": "夜明けと蛍",
"sc": -5,
"bpm": 79,
"ts": 4,
"arp": 1,
"scores": [
["15,-5,0,12", "7"],
["-5,0,15,12", "7"],
["-5,10,2,14", "5"],