Skip to content

Instantly share code, notes, and snippets.

Writing in Haskell, TypeScript, or Power Automate

YAMAMOTO Yuji igrep

Writing in Haskell, TypeScript, or Power Automate
View GitHub Profile
mrtry /
Created May 21, 2021 08:53
# Project rootに移動
cd $(git rev-parse --show-toplevel)
if [ "$(cat .xcode-version)" != "$(xcodebuild -version | awk 'NR==1{print $2}')" ]; then
echo 'Invalid Xcode version'
echo ".xcode-version: $(cat .xcode-version)"
echo "xcodebuild version: $(xcodebuild -version | awk 'NR==1{print $2}')"
exit 1
mrtry / Gemfile
Last active May 23, 2021 10:49
Bump version for react-native
View Gemfile
# android/ ios/ に配置
source ""
fastlaneVersion = File.join(File.dirname(__FILE__), '../fastlane-version')
eval_gemfile(fastlaneVersion) if File.exist?(fastlaneVersion)
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
mrtry / post-checkout
Created May 19, 2021 12:11
run `npm install` when update package.json
View post-checkout
. "$(dirname "$0")/_/"
prevPackageHash=$(git log --format="%C(auto)%h%Creset" -n 1 $prevHEAD -- package.json | cat)
nextPackageHash=$(git log --format="%C(auto)%h%Creset" -n 1 $nextHEAD -- package.json | cat)
if [ "$prevPackageHash" != "$nextPackageHash" ]; then
mengwangk / compe.lua
Last active January 10, 2022 01:57
Neovim LSP Enhanced - compe.lua
View compe.lua
-- Configuration for nvim-compe
local utils = require('utils')
vim.cmd [[set shortmess+=c]]
utils.opt('o', 'completeopt', 'menuone,noselect')
require'compe'.setup {
enabled = true;
autocomplete = true;
mengwangk / init.lua
Created March 13, 2021 13:14
Neovim LSP Enhanced - init.lua
View init.lua
local on_attach = function(client, bufnr)
-- require('completion').on_attach()
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
-- Mappings.
wataash / linux-esp-decryption.hs
Last active September 1, 2020 06:36
linux L2TP/IPsec ESP decryption
View linux-esp-decryption.hs
$ sudo ip xfrm state
↓ info for local→remote direction IPsec tunnel(ESP)
src dst
proto esp spi 0xaaaaaaaa reqid 1 mode transport
replay-window 0
auth-trunc hmac(sha1) 0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 96
enc cbc(aes) 0xcccccccccccccccccccccccccccccccccccccccccccccccccccccccc
encap type espinudp sport 4500 dport 4500 addr
anti-replay context: seq 0x0, oseq 0xaab, bitmap 0x00000000
sel src dst
bushidocodes /
Last active July 30, 2020 23:47
WebAssembly Summit 2020 Notes

WebAssembly Summit 2020

Lin Clark's Talk - "WebAssembly Nanoprocess"

  • the missing functionality alongside WASI and Interface Types is something that provides "capability-based security".
  • Delegation of permissions to propagate down transitive dependencies
  • plan to use fine-grain form of per-module virtualization
  • A "WebAssembly nanoprocess" is just wasm, but follows a particular pattern.
chrisdone /
Last active February 1, 2023 08:52
Statically checked overloaded strings

Statically checked overloaded strings

This gist demonstrates a trick I came up with which is defining IsString for Q (TExp a), where a is lift-able. This allows you to write $$("...") and have the string parsed at compile-time.

On GHC 9, you are able to write $$"..." instead.

This offers a light-weight way to enforce compile-time constraints. It's basically OverloadedStrings with static checks. The inferred return type

#!/usr/bin/env python3
import zipfile
import sys
import re
import xml.etree.ElementTree as ET
namespaces = {
'a': '',
'r': '',
HirotoShioi /
Last active May 15, 2019 02:43



  • Model based test
  • Metamorphic test
  • Postconditions
  • Round-trip test


  • 有効なテストがどの程度の頻度で行われているのか確認しよう。(例:リストに存在しない値に対するlookupがテストの大半を占めていないか)