Cのあれこれ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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, ' ') | |
} catch (error) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function (.*)\((.*)\) \{ | |
const $1 = ($2) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
虹色に光る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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from time import sleep | |
target_url = "" | |
alert_api = "" | |
calloff_api = "" | |
def loop(): | |
mode="yellow" | |
while 1: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gcc tst.c -lm -o b.out | |
./b.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lku ㇰ | |
xku ㇰ | |
xshi ㇱ | |
lshi ㇱ | |
xsi ㇱ | |
lsi ㇱ | |
xsu ㇲ | |
lsu ㇲ | |
xto ㇳ | |
lto ㇳ |
NewerOlder