Skip to content

Instantly share code, notes, and snippets.

@enerick
enerick / fetch-pr-list.sh
Last active Sep 14, 2021
Create md file that lists PR/Issues I created within the period (requires `gh` command)
View fetch-pr-list.sh
for i in 1 2 3 4 5
do
gh api -X GET search/issues \
-f q='archived:false created:2021-04-01..2021-09-30 author:@me sort:created-asc' \
-f per_page=100 \
-f page=$i \
-q '.items | map(. += { "repo": (.html_url | split("/") | .[-4] + "/" + .[-3] + "#" + .[-1]), "date": (.created_at | split("T") | .[0]) }) | map("1. " + .date + " [" + .title + "](" + .html_url + ") (" + .repo + ")") | .[]' \
>> pr.md
done
@enerick
enerick / bakusoku-chouseisan.js
Last active Sep 2, 2021
爆速調整さんブックマークレット
View bakusoku-chouseisan.js
javascript: document.querySelectorAll(".oax").forEach(function(e) {e.addEventListener("mouseenter", function() { e.parentNode.childNodes.forEach((e) => { e.classList.remove("active"); }); e.classList.add("active"); e.parentNode.firstElementChild.value = parseInt(e.id.slice(-1)) + 1}, false);})
@enerick
enerick / basic.ex
Last active Dec 19, 2019
introduction to params (v2.1.2?)
View basic.ex
# モジュール内定義
defmodule M do
use Params
defparams person_params(%{
name!: :string,
age: :integer
})
end
@enerick
enerick / setting.vssettings
Created Jul 31, 2015
VSショートカットキー設定。Ctrl+a, Ctrl+e で行頭行末移動、全選択は Alt+a、Ctrl+g, Alt+g Alt+g で指定行ジャンプ
View setting.vssettings
<UserSettings>
<ApplicationIdentity version="11.0"/>
<ToolsOptions>
<ToolsOptionsCategory name="Environment" RegisteredName="Environment"/>
</ToolsOptions>
<Category name="Environment_Group" RegisteredName="Environment_Group">
<Category name="Environment_KeyBindings" Category="{F09035F1-80D2-4312-8EC4-4D354A4BCB4C}" Package="{DA9FB551-C724-11d0-AE1F-00A0C90FFFC3}" RegisteredName="Environment_KeyBindings" PackageName="Visual Studio Environment Package">
<Version>11.0.0.0</Version>
<KeyboardShortcuts>
<ScopeDefinitions>
@enerick
enerick / private.xml
Created May 26, 2015
a configuration file for Karabiner
View private.xml
<?xml version="1.0"?>
<root>
<devicevendordef>
<vendorname>TopreCorporation</vendorname>
<vendorid>0x0853</vendorid>
</devicevendordef>
<item>
<name>For RealForce</name>
<name>Set function keys to special feature</name>
<appendix>Assign special feature keys to F1 to F12 on RealForce</appendix>
@enerick
enerick / tex.sh
Created Jun 7, 2012
単発tex用スクリプト
View tex.sh
#!/bin/sh
#Mac以外は知らない
#拡張子を除いた名前を引数として渡す(ex. hoge.tex -> hoge)
platex $1.tex
if [ $? -eq 0 ];then
dvipdfmx $@
else
exit 0
@enerick
enerick / CA184.ml
Created Dec 13, 2011
愚直実装版1次元CAくん(状態を配列に収めてインデックスに状態を割り当てるみたいな工夫は一切無い)
View CA184.ml
let rec print_int_list = function
| [] -> print_newline ()
| x::xs -> print_int x; print_int_list xs;;
(* リストの両端のはみ出しに対応させた拡張nth関数 *)
let nth_ex li = function
| n when n < 0 -> List.nth li (List.length li - 1)
| n when n >= (List.length li) -> List.nth li 0
| n -> List.nth li n;;