Skip to content

Instantly share code, notes, and snippets.

View rch850's full-sized avatar
:shipit:
Delivery every week

rch850 rch850

:shipit:
Delivery every week
View GitHub Profile
@rch850
rch850 / hello-ktor.main.kts
Created July 28, 2021 01:38
hello-ktor.main.kts
// 参考:
// * https://blog1.mammb.com/entry/2020/12/08/224315
@file:DependsOn("io.ktor:ktor-server-netty:1.4.3")
@file:DependsOn("ch.qos.logback:logback-classic:1.2.3")
import io.ktor.application.*
import io.ktor.http.*
import io.ktor.response.*
import io.ktor.routing.*

Export environment variable

# bash
export AWS_PROFILE=myproj

# fish
set -x AWS_PROFILE myproj
@rch850
rch850 / tig.md
Last active March 6, 2023 00:52
よく使う tig のオプションなど

tig -S'hoge'

git log -p -S hoge 相当。捗る。

tig --first-parent

現在いるブランチへのマージコミットだけを列挙する。

# 指定したファイルに関するマージコミットだけを列挙する。
# Simulate Monty Hall Problem
# https://analytics-notty.tech/very-good-explain-montyhall-problem/
import random
def game(change):
doors = [1, 2, 3]
bingo = random.choice(doors)
hand = random.choice(doors)
@rch850
rch850 / connpass2sheet.gs
Last active April 20, 2019 07:43
Google Apps Script which copies connpass events to spreadsheet.
// Compiled using ts2gas 1.6.2 (TypeScript 3.4.4)
var exports = exports || {};
var module = module || { exports: exports };
//import { ConnpassEventsResponse } from "./connpass";
// Connpass API: https://connpass.com/about/api/
//
// 2400 is a series id of ふくもく会.
// Your series id can be revrieved by calling
// https://connpass.com/api/v1/event/?event_id=YOUR_EVENT_ID
var CONNPASS_SERIES_ID = 2400;
const process = require('process')
const https = require('https')
const slackToken = process.env.SLACK_TOKEN
if (!process.env.SLACK_TOKEN) {
console.error('Environment variable SLACK_TOKEN is empty!')
process.exit(1)
}
if (!process.argv[2]) {
console.error('usage: node slack-reactions.js MESSAGE_URL')
@rch850
rch850 / curling.js
Created February 25, 2018 05:03
curling
var express = require('express');
var router = express.Router();
const AA = `| |
| |
| |
| |
| |
| |
| |
@rch850
rch850 / WindowsVMSetup.md
Last active May 28, 2018 08:14
Windows VM Setup

Edge や IE での動作確認のため Microsoft からダウンロードした VirtualBox の VM をいい感じにセットアップするためのメモ。

スペックの目安

  • メインメモリー 4096MB
  • ビデオメモリ 128MB

オススメ初期化フロー

時間がかかる部分について

@rch850
rch850 / fresh-chrome.sh
Last active September 7, 2017 08:46 — forked from stuartsierra/fresh-chrome.sh
Launch new instances of Google Chrome on OS X with isolated cache, cookies, and user config
#!/usr/bin/env bash
# fresh-chrome
#
# Use this script on OS X to launch a new instance of Google Chrome
# with its own empty cache, cookies, and user configuration.
#
# The first time you run this script, it will launch a new Google
# Chrome instance with a permanent user-data directory, which you can
# customize below. Perform any initial setup you want to keep on every