Skip to content

Instantly share code, notes, and snippets.

View shisama's full-sized avatar

Masashi Hirano shisama

View GitHub Profile
@shisama
shisama / nodejs-v13-semver-major-list.md
Created March 29, 2021 13:08
Node.js Semver Major List
  • [5981fb7faa] - (SEMVER-MAJOR) assert: fix line number calculation after V8 upgrade (Michaël Zasso) #29694
  • [48d1ea5e7f] - (SEMVER-MAJOR) assert: special handle identical error names in instance checks (Ruben Bridgewater) #28263
  • [97c52ca5dc] - (SEMVER-MAJOR) assert: add more information to AssertionErrors (Ruben Bridgewater) #28263
  • [5700cd17dd] - (SEMVER-MAJOR) assert: do not repeat .throws() code (Ruben Bridgewater) #28263
  • [d47b6786c9] - (SEMVER-MAJOR) assert: wrap validation function errors (Ruben Bridgewater) [#28263]
@shisama
shisama / career_ja.md
Last active August 19, 2022 03:42
shisama's career in Japanese

基本情報

平野昌士(Masashi Hirano)

大阪在住です。
2012年からソフトウェア開発に従事しています。
主にWebアプリケーションの開発を行っています。

@shisama
shisama / proxy_server.js
Last active September 20, 2023 14:26
Node.js Proxy Server with Basic Auth Sample
const http = require("http");
const { parse } = require("basic-auth");
const { PROXY_USERNAME, PROXY_PASSWORD } = process.env;
const PROXY_PORT = process.env.PROXY_PORT || 8000;
const check = (credentials) => {
return (
credentials &&
credentials.username === PROXY_USERNAME &&
credentials.pass === PROXY_PASSWORD
const path = require('path');
const fs = require('fs');
const { promisify } = require('util');
const glob = promisify(require('glob'));
const FROM = '.css';
const TO = '.scss';
const mv = async file => {
const out = `${path.join(
path.dirname(file),
function createMachine(stateMachineDefinition) {
const machine = {
value: stateMachineDefinition.initialState,
transition(currentState, event) {
const currentStateDefinition = stateMachineDefinition[currentState];
const destinationTransition = currentStateDefinition.transitions[event];
if (!destinationTransition) {
return;
}
const destinationState = destinationTransition.target;
@shisama
shisama / weblio2csv.js
Created January 12, 2020 11:21
Weblioの単語帳画面から単語と意味をカンマ区切りの一覧で引っこ抜いてクリップボードにコピーするスクリプト
copy(Object.values(document.getElementsByClassName("tngMainTrOn")).map(el => {
const text = el.innerText
const textArr = text.split("\n")
const en = textArr[0]
const ja = textArr[2].split(",").join("、")
return `${en}, ${ja}`;
}).join("\n"))
const start = performance.now();
interface Member {
name: string;
birthday?: Date;
url?: string;
instrument?: string;
}
const john: Member = {
name: 'John Lennon',
const start = performance.now();
interface Member {
name: string;
birthday: Date;
url: string;
instrument: string;
}
const john: Member = {
name: 'John Lennon',
const start = performance.now();
interface Member {
name: string;
birthday: Date | null;
url: string | null;
instrument: string | null;
}
const john: Member = {
name: 'John Lennon',
const start = performance.now();
interface Member {
name: string;
birthday: Date | null;
url: string | null;
instrument: string | null;
}
const john: Member = {
name: 'John Lennon',