Skip to content

Instantly share code, notes, and snippets.

View katai5plate's full-sized avatar

Hadhad / HanoHano katai5plate

View GitHub Profile
@0b5vr
0b5vr / genbun.glsl
Last active August 7, 2021 14:55
prod05 sierpinski chord by 0x4015完全理解した
// https://www.youtube.com/watch?v=H8UqnTE3mUY より引用
#define A for(int i=0;i<9;++i){int y=p>>((p>>19)+i&3),z=p*((878086607>>(i&7)*4)&15)*(510+1%5)>>14;if((p>>15&1<<(i&15))>0)s.y+=float(((y>>7&z*3|y>>11&z*6)&1023)-512)/3e4;}
vec2 mainSound(float t){int p=int(t*144e3);vec2 s;A;s.yx=s;p-=65536;A;return s*mat2(7,1,5,-3);}
#version 410 core
uniform float fGlobalTime; // in seconds
uniform vec2 v2Resolution; // viewport resolution (in pixels)
uniform sampler1D texFFT; // towards 0.0 is bass / lower freq, towards 1.0 is higher / treble freq
uniform sampler1D texFFTSmoothed; // this one has longer falloff and less harsh transients
uniform sampler1D texFFTIntegrated; // this is continually increasing
uniform sampler2D texChecker;
uniform sampler2D texNoise;
@triacontane
triacontane / PluginName.js
Last active August 17, 2020 07:40
実行しているプラグインのファイル名を取得する。
(function() {
'use strict';
var script = document.currentScript;
var pluginName = script.src.replace(/^.*\/(.*).js$/, function() {
return arguments[1];
});
console.log(pluginName);
})();
@kenmori
kenmori / TypeScriptPractice.md
Last active April 22, 2024 13:05
TypeScript 練習問題集
@kurone-kito
kurone-kito / groupByPrefix.ts
Last active June 19, 2019 01:55
Group duplicate prefixes in the strings: (src: string[]) => string[]
const getInitials = (src: string[], length = 1) =>
Array.from(new Set(src.map(v => v.substring(0, length))));
export default (src: string[]) =>
getInitials(src).map(initial => {
const list = src.filter(v => v.match(`^${initial}`));
const rec = (prev: string, length = 2): string => {
const [word, ...{ length: l }] = getInitials(list, length);
return l || list[0].length < length ? prev : rec(word, length + 1);
@kurone-kito
kurone-kito / onBackHome.js
Created January 20, 2019 09:39
Script for AWS Lambda: To judge if at night and to pass the result to the Webhooks of IFTTT.
const https = require('https');
const ifttt = event => `https://maker.ifttt.com/trigger/${event}/with/key/${process.env.IFTTT_WEBHOOK_KEY}`;
exports.handler = async (event) => {
const time = new Date();
const valid = time.getHours() >= 18;
const eventId = valid ? 'night' : 'other';
await new Promise(r => https.get(ifttt(eventId), r));
const response = { statusCode: 200, body: eventId };
@katai5plate
katai5plate / mobx-with-decorators-in-create-react-app.md
Last active July 6, 2018 08:36
日本語訳:MobX (with Decorators) in create-react-app

元記事

MobX (with Decorators) in create-react-app

デコレータと一緒にMobXをcreate-react-appで使う方法

MobXは、モダンアプリのステート管理に使います。
多くの場合、React.jsアプリに適用されますが、必ずしもReactにバインドされているわけではありません。
さらに、Reduxのステート管理ソリューションとして貴重な選択肢です。
create-react-appをボイラープレートとして使っている場合は、
MobXを設定する方法とcreate-react-appでデコレータを使う方法にぶつかります。

@danmaq
danmaq / showMarkdown.html
Last active April 30, 2018 06:41
If you embed Markdown, you can preview on browser only this HTML. Using: chjj/marked
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0" />
<title>Markdown preview</title>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/2.8.0/github-markdown.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/marked/0.3.6/marked.min.js" integrity="sha384-aP8BvMiS2buEdB040zV1ZNg4Yz3vzmY0biq0UhB05amexdPMAx3uPjIvFWKa7Jnz" crossorigin="anonymous"></script>
<script type="text/template" id="source">
# Hello, world
@jaytaylor
jaytaylor / react-unexpected-use-of-location.md
Created July 12, 2017 22:44
Solution for "Unexpected use of 'location'" React error.
React: Unexpected use of 'location';

Solution: Use window.location instead of bare location.

@joyrexus
joyrexus / README.md
Last active February 24, 2024 15:16
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")