Skip to content

Instantly share code, notes, and snippets.

View katai5plate's full-sized avatar

Hadhad / HanoHano katai5plate

View GitHub Profile
@danmaq
danmaq / call_windows_update.cmd
Last active November 19, 2017 22:30
Script of apply Windows Update automatically. (includes: http://www.vwnet.jp/Windows/PowerShell/FullAutoWU.htm )
@echo off
whoami /groups | Find "High Mandatory Level" > NUL
if not errorlevel 1 goto RUN
powershell -Command Start-Process -Verb runas "%0"
exit /b %errorlevel%
:RUN
powershell -NoProfile -ExecutionPolicy Unrestricted "$s=[scriptblock]::create((gc \"%~f0\"|?{$_.readcount -gt 9})-join\"`n\");&$s" %*
exit /b 0
Set-StrictMode -Version 2.0
@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
@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でデコレータを使う方法にぶつかります。

@jed
jed / LICENSE.txt
Created May 10, 2011 16:06 — forked from 140bytes/LICENSE.txt
walk and filter DOM nodes by function
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@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 };
@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);
#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);
})();
@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);}
@tatesuke
tatesuke / anti-excel-hoganshi.html
Last active January 5, 2023 11:58
完全に単一のhtmlでmarkdown
<!DOCTYPE html>
<meta charset="utf-8">
<title>Javaによる開発の流れ</title>
<script type="text/template" id="content1">
<!--==================================================================
↓ここからmarkdownを記述します
====================================================================-->
# Javaによる開発の流れ