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 / ffmpeg-i-have-used.md
Last active February 13, 2024 09:36
ffmpeg command history
@rch850
rch850 / tig.md
Last active March 6, 2023 00:52
よく使う tig のオプションなど

tig -S'hoge'

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

tig --first-parent

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

# 指定したファイルに関するマージコミットだけを列挙する。
@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
log_format postdata '$time_local $request $request_body';
location = /path {
access_log /var/log/nginx/postdata.log postdata;
proxy_pass http://localhost:8080; # <= set your port
}
# 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')