Skip to content

Instantly share code, notes, and snippets.

<body onLoad="img()">
<div class="pc">
<canvas width="900" height="600" id="sample1"></canvas>
</div>
<div class="pad">
<canvas width="400" height="600" id="sample2"></canvas>
</div>
<div class="mobile">
<canvas width="150" height="900" id="sample3"></canvas>
</div>
@okumurakengo
okumurakengo / index.html
Last active October 18, 2021 08:41
Native File System API Test
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<h1>aa</h1>
@okumurakengo
okumurakengo / index.css
Last active November 13, 2019 04:58
webpack4でsideEffectsでcssのツリーシェイキングの動きを試してみた
/* src/index.css */
body {
background: yellow;
}
@okumurakengo
okumurakengo / index.ts
Created November 24, 2019 06:07
typescriptでfizzbuzz
function fizzbuzz(n: number): number|"Fizz"|"Buzz"|"FizzBuzz" {
if (n % 15 === 0) {
return "FizzBuzz";
}
if (n % 3 === 0) {
return "Fizz";
}
if (n % 5 === 0) {
return "Buzz";
}
@okumurakengo
okumurakengo / index.ts
Created December 18, 2019 04:58
ts unknown test
let value1: any;
value1 = true; // OK
value1 = 42; // OK
value1 = "Hello World"; // OK
value1 = []; // OK
value1 = {}; // OK
value1 = Math.random; // OK
value1 = null; // OK
value1 = undefined; // OK
value1 = new TypeError(); // OK
@okumurakengo
okumurakengo / index.html
Created March 16, 2020 04:34
fullscreen style
<!DOCTYPE html>
<meta charset="UTF-8">
<title>Document</title>
<style>
#my-text {
color: #faa;
}
#my-text:fullscreen {
color: #afa;
}
@okumurakengo
okumurakengo / test.js
Created May 6, 2020 07:31
ユークリッドの互除法
let a = 273
,b = 1001
function* foo() {
while (true) {
yield (a < b) ? [a, b - a] : [a - b, a]
}
}
for ([a, b] of foo(a, b)) {
@okumurakengo
okumurakengo / files.js
Created May 8, 2020 09:06
フォルダ階層たどってJSONにしてくれるの
module.exports = `
foo.html
bar/hoge/fuga.php
bar/hoge/piyo.php
bar/hogera.php
baz/fugara.php
`
@okumurakengo
okumurakengo / bar.txt
Created May 17, 2020 07:26
c言語で排他的論理和を使って超簡単に暗号化、複合化
SLHFNLM
@okumurakengo
okumurakengo / marrige.c
Last active May 18, 2020 17:56
安定結婚問題練習
#include <stdio.h>
#include <stdlib.h>
#define N 3 /* 各性の人数 */
int
/* 添字(女性1..3) => 値(男性1..3) */
boy[4] = {0, 0, 0, 0}
/* 各女性の好み */
// rank[女性1..3][男性1..3] = ランク