Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
キーボードをカスタムしてプログラミング環境を良くした話 / Improved programm...
Search
Takayuki Matsubara
September 08, 2018
Programming
0
1.2k
キーボードをカスタムしてプログラミング環境を良くした話 / Improved programming environment with customizing keybords
2018/09/08 builderscon tokyo 2018 の LT スライドです。
Elixir の `|>` 演算子を1キー押すだけで入力できるようにする話です。
Takayuki Matsubara
September 08, 2018
Tweet
Share
More Decks by Takayuki Matsubara
See All by Takayuki Matsubara
Rails Web Development with AWS Lambda
ma2gedev
0
220
Coding Challenge Advent of Code 2019
ma2gedev
0
120
Developer Experience in GraphQL Schema-first Development
ma2gedev
0
2.1k
Dependency Inversion Principle in Keyboard Firmware
ma2gedev
0
430
OSSの歩き方 / Walking with OSS
ma2gedev
10
2.5k
GraphQL 開発で必要になったこと / What we needed for GraphQL development
ma2gedev
0
1.1k
Translating "Erlang in Anger" with Erlang & Elixir community members
ma2gedev
0
2.8k
Dive into Elixir v1.6 Code Formatter
ma2gedev
1
160
Make it easy to input `|>`
ma2gedev
2
2.7k
Other Decks in Programming
See All in Programming
バグを見つけた?それAppleに直してもらおう!
uetyo
0
180
PHPで学ぶプログラミングの教訓 / Lessons in Programming Learned through PHP
nrslib
3
300
テストコードのガイドライン 〜作成から運用まで〜
riku929hr
5
730
PSR-15 はあなたのための ものではない? - phpcon2024
myamagishi
0
140
Security_for_introducing_eBPF
kentatada
0
110
「Chatwork」Android版アプリを 支える単体テストの現在
okuzawats
0
180
Amazon S3 NYJavaSIG 2024-12-12
sullis
0
100
今年のアップデートで振り返るCDKセキュリティのシフトレフト/2024-cdk-security-shift-left
tomoki10
0
210
わたしの星のままで一番星になる ~ 出産を機にSIerからEC事業会社に転職した話 ~
kimura_m_29
0
180
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
480
数十万行のプロジェクトを Scala 2から3に完全移行した
xuwei_k
0
280
フロントエンドのディレクトリ構成どうしてる? Feature-Sliced Design 導入体験談
osakatechlab
8
4.1k
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
133
9k
Java REST API Framework Comparison - PWX 2021
mraible
28
8.3k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
111
49k
A designer walks into a library…
pauljervisheath
204
24k
Music & Morning Musume
bryan
46
6.2k
Into the Great Unknown - MozCon
thekraken
33
1.5k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
810
Code Reviewing Like a Champion
maltzj
520
39k
KATA
mclloyd
29
14k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
17
2.3k
Transcript
ΩʔϘʔυΛΧελϜ͠ ͯϓϩάϥϛϯάڥΛ ྑͨ͘͠ builderscon tokyo 2018 @ma2ge
PowerAssertEx ⭐ 160+ github.com/ma2gedev/power_assert_ex
! Elixir
|> ύΠϓԋࢉࢠ https://elixir-lang.org/getting-started/enumerables-and-streams.html#the-pipe-operator
ύΠϓԋࢉࢠͷΘΕํ # without pipe Enum.sum(Enum.map(1..100_000, &(&1 * 3))) # with
pipe 1..100_000 |> Enum.map(&(&1 * 3)) |> Enum.sum
͔͍͍ͬ͜ɻɻɻ͕ͩ |> ࠷ߴʹଧͪʹ͍͘
None
3
3 to 1
!
QMK https://github.com/qmk/qmk_firmware
ࣄલʹඞཁͳ Firmware Λॻ͖ࠐΊΔΩʔϘʔυ
۩ମతʹ ErgoDox EZ, Infinity ErgoDox, Planck, Helix ͳͲͷࣗ࡞Ω ʔϘʔυք۾ͰΑ͘ݟΔΩʔϘʔυ https://github.com/qmk/qmk_firmware/blob/master/keyboards/readme.md
! ͜ΕΒΛপ1ʹམͪͳ͍Α͏ʹؾ Λ͚ͭͭͭखʹೖΕ·͢(ࣗݾ) 1 ΩʔΩϟοϓ͔Β࢝·ΓɺΩʔεΠονέʔεΛม͑ͨ͘ͳͬͨΓɺଞͷΩʔϘʔυཉ͘͠ͳͬͨΓɻ͔ͳ ΓͷপͰ͢ɻ
QMK ͰಠࣗΩʔϚοϓ࡞Δ४උ # fork ͨ͠ͷΛ clone ͢Δͷ͕ΦεεϝͰ͢ $ git clone
[email protected]
:qmk/qmk_firmware.git $ cd qmk_firmware # ରԠ͢ΔΩʔϘʔυͷ keymap.c Λมߋ͢Δײ͡ɻ # ҎԼ Infinity ErgoDox ͷྫ $ cp -r keyboards/ergodox_infinity/keymaps/{default,your_own} $ vi keyboards/ergodox_infinity/keymaps/your_own/keymap.c
QMK Λ͏͜ͱͰΩʔϚοϓม͑ΒΕΔ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap
0: Basic layer * * ,--------------------------------------------------. ,--------------------------------------------------. * | Esc | 1 | 2 | 3 | 4 | 5 | Del | | |> | 6 | 7 | 8 | 9 | 0 | - | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * | Tab | Q | W | E | R | T | ` | | ' | Y | U | I | O | P | BkSp | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | LCtrl | A | S | D | F | G |------| |------| H | J | K | L |; / L1| Enter | * |--------+------+------+------+------+------| Hyper| | B |------+------+------+------+------+--------| * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * |Grv/L1| Meh |AltShf| LALT | LGui| | \ | = | [ | ] | ~L1 | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. * | Up | Down | | Left | Right | * ,------|------|------| |------+--------+------. * | | | Home | | PgUp | | | * | Space| LANG1|------| |------| LANG2 |Enter | * | | | End | | PgDn | | /L2 | * `--------------------' `----------------------' */ https://github.com/ma2gedev/qmk_firmware/blob/ma2gedev/keyboards/ergodox/keymaps/ma2gedev/keymap.c
͞ΒʹϚΫϩͷػೳ͕͋Γ·͢ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
switch(id) { case 0: if (record->event.pressed) { SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); } break; /* লུ */ } return MACRO_NONE; };
keycode ͷΘΓʹϚΫϩΛݺͼग़͢ /* ௨ৗΩʔίʔυΛॻ͘ͱ͜Ζ */ KEYMAP(..., KC_1, ...) /* action_get_macro
Λݺͼग़ͨ͢Ίͷ M ϚΫϩΛઃఆ͢Δ */ KEYMAP(..., M(0), ...)
ϚΫϩΛՃ͢Δ͜ͱͰύΠϓԋࢉࢠΛ ࣮ݱͯ͠Έ·͠ΐ͏ /* @action_get_macro ʹҎԼΛՃ */ case 2: if (record->event.pressed)
{ // For Elixir pipe operator SEND_STRING ("|>"); } break; /* keymaps ͷྻͰΧελϚΠζ͍ͨ͠ΩʔͷϚοϐϯάΛҎԼʹมߋ */ KEYMAP(..., M(2), ...)
ϑΝʔϜΣΞͷॻ͖ࠐΈํ๏ # ҎԼͷΩʔϘʔυ͝ͱͷσΟϨΫτϦʹ readme.md ͕͍͍ͩͨೖ͍ͬͯΔͷͰͦΕݟΔ https://github.com/qmk/qmk_firmware/tree/master/keyboards/ # Infinity ErgoDox ͷ߹
https://github.com/qmk/qmk_firmware/blob/master/keyboards/ergodox_infinity/readme.md
None
!!!
3 to 1
twitter: @ma2ge M3, Inc. / ΤϜεϦʔגࣜձࣾ https://www.m3tech.blog