Skip to content

Instantly share code, notes, and snippets.

@koseki
koseki / bingchat-ime-fix.user.js
Last active October 16, 2023 00:29
macOS の Edge で Bing chat を使うと日本語入力確定時に勝手に送信されてしまう問題に対応する userscript
// ==UserScript==
// @name Bing Chat IME fix
// @namespace https://gist.github.com/koseki/d377f8f2e6df6655a1e160a4e03421d1
// @version 0.4
// @description macOS の Edge で Bing chat を使うと日本語入力確定時に勝手に送信されてしまう問題の対応です
// @author koseki
// @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
// @match https://www.bing.com/*
// @grant none
// ==/UserScript==
@koseki
koseki / generate.js
Created November 27, 2022 16:20
mv test
const fs = require('fs-extra');
async function main(size) {
for (let i = 0; i < 5; i++) {
console.log(i)
let s = '';
for (let j = 0; j < size; j++) {
s += i
}
await fs.outputFile(`${i}.txt`, s)
@koseki
koseki / excel-column-name.txt
Last active August 29, 2022 11:43
Excel Column Name 1 to 1000 Text (Copy & Paste instead of Autofill)
A
B
C
D
E
F
G
H
I
J
@koseki
koseki / README.md
Last active June 13, 2021 01:13
Dump RPM headers
@koseki
koseki / dump-rpm-headers.py
Last active June 12, 2021 12:22
Dump RPM headers
#! /usr/bin/env python
import struct
from ctypes import *
import io
import re
from enum import Enum
from sys import argv
@koseki
koseki / index.js
Last active April 11, 2021 02:48
Memoized Async Function
import axios from 'axios'
class App {
constructor() {
this.cache = {}
}
/**
* 何もキャッシュしないバージョン
*/
@koseki
koseki / aioredis_reconnection.py
Last active January 4, 2021 10:17
aioredis Pub/Sub reconnection
import asyncio
from typing import List
import aioredis
from aioredis import Redis
from aioredis.pubsub import Channel
from aioredis.connection import RedisConnection
class Sample:
@koseki
koseki / README.md
Last active December 14, 2020 11:53
日本の市外局番と都道府県の対応 Phone Number Area Code and Prefectures in Japan
@koseki
koseki / MFARequiredForCurrentUsers.json
Last active August 4, 2022 10:41
MFA required IAM Policies
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowViewAccountInfo",
"Effect": "Allow",
"Action": [
"iam:GetAccountPasswordPolicy",
"iam:ListVirtualMFADevices"
],
@koseki
koseki / dst.md
Last active April 23, 2021 01:32
サマータイム終了時の挙動

タイムゾーン America/Los_Angeles では、サマータイム終了日 2018/11/04 の 01:00:00 〜 01:59:59 が2度繰り返される。

Ruby の Time は、午前1時台をサマータイム終了後として扱っている。

irb(main):001:0> ENV['TZ'] = 'America/Los_Angeles'
=> "America/Los_Angeles"
irb(main):002:0> Time.local(2018, 11, 4, 0, 59, 0)
=> 2018-11-04 00:59:00 -0700
irb(main):003:0> Time.local(2018, 11, 4, 0, 59, 0).dst?