Skip to content

Instantly share code, notes, and snippets.

@budoucha
budoucha / consoleloginpage.js
Last active February 12, 2024 19:01
outputs console.log to output element
// override console.log
const oldConsoleLog = console.log;
console.log = (...args) => {
const msgStr = args.map(arg => {
if (typeof arg === 'object') {
try {
return JSON.stringify(arg, null, 2)
.replace(/\n/g, '<br>')
.replace(/\s/g, '&nbsp;')
} catch (error) {
@budoucha
budoucha / consoleMidiInput.js
Created February 12, 2024 12:30
nodejs script to get midi input
const midi = require('midi');
const input = new midi.Input();
// 入力可能なMIDIデバイスの数を取得
const ports = input.getPortCount();
for (let i = 0; i < ports; i++) {
console.log(input.getPortName(i));
}
@budoucha
budoucha / memo.txt
Last active January 21, 2024 08:45
replace traditional function declaration into arrow function declaration in VS Code
function (.*)\((.*)\) \{
const $1 = ($2) => {
@budoucha
budoucha / Custom CSS(Rainbow)
Last active April 7, 2023 05:54
ブログ生成に使用したプロンプト
虹色に光るCSS
```
h1 {
background-image: linear-gradient(to right, red, orange, yellow, green, blue, indigo, violet);
background-size: 200%;
background-clip: text;
-webkit-background-clip: text;
color: transparent;
animation: rainbow 4s linear infinite;
@budoucha
budoucha / watch.py
Last active May 27, 2018 05:13
Wifi device watchdog script
import requests
from time import sleep
target_url = ""
alert_api = ""
calloff_api = ""
def loop():
mode="yellow"
while 1:
@budoucha
budoucha / README.md
Last active June 24, 2017 07:02
Cのあれこれ

Cのあれこれ

@budoucha
budoucha / run.sh
Created June 24, 2017 06:25
久々にC書くときに楽するためのやつ
gcc tst.c -lm -o b.out
./b.out
@budoucha
budoucha / loopCount.py
Created June 2, 2017 07:44
to stop loop do >touch break
import glob
import time
value = 0
while len(glob.glob("break"))==0:
time.sleep(1)
value += 1
f = open("record","w")
f.write(str(value)+"\n")
f.close
@budoucha
budoucha / rainbow.pde
Created April 13, 2017 11:41
simple processing sketch to draw a full window rainbow.
void setup(){
size(640,480);
background(0);
colorMode(HSB);
}
void draw(){
for(int i =0;i<width;i++){
strokeWeight(1);
stroke((i+frameCount*2)%width*255/width,255,255);
@budoucha
budoucha / kogaki.txt
Last active March 3, 2017 09:16
Google日本語入力で小書き文字を入力できるようにします。エクスポートされたromantable.txtの末尾に以下の文字列を追加したものをインポートし直します。
lku ㇰ
xku ㇰ
xshi ㇱ
lshi ㇱ
xsi ㇱ
lsi ㇱ
xsu ㇲ
lsu ㇲ
xto ㇳ
lto ㇳ