Skip to content

Instantly share code, notes, and snippets.

@adeonhy
adeonhy / trackball_gb.md
Last active Sep 20, 2018
トラックボールモジュールGBについて
View trackball_gb.md
View qmk_keymap_cookbook.md

Layer切り替え系

  • DF(layer) デフォルトレイヤーを変更。テンキーモード、GAMEモードなど
  • MO(layer) 押している間だけレイヤーを変更
  • LM(layer, mod) As MO(layer) but with mod active
  • LT(layer, kc)
  • TG(layer) Toggles the layer (enables it if no active, and vise versa)
  • TO(layer) Activates layer and deactivates all other layers
  • TT(layer) Momentarily activates layer if held, toggles it if tapped repeatedly
@adeonhy
adeonhy / karabiner_mouse_button45.json
Created Jul 11, 2018
Karabiner-Elementsでマウスのボタン4/5にキー割り当て
View karabiner_mouse_button45.json
{
"title": "マウスのButton4/5にキーを割り当てる",
"rules": [
{
"description": "Button5 -> Cmd-h, Button4 -> Cmd-l",
"manipulators": [
{
"type": "basic",
"from": {
"pointing_button": "button5"
View qmk_lspo_rspc_for_karabiner_elements.json
{
"description": "Shiftを単体で押したときに、(/)キーを送信する。(左Shiftは(、右Shiftは) )",
"manipulators": [
{
"from": {
"key_code": "left_shift",
"modifiers": {
"optional": [
"any"
]
@adeonhy
adeonhy / notify_mining.sh
Created Jan 3, 2018
ETHマイニング状況をslackに投げるやつ
View notify_mining.sh
ETH_POOL_URL=https://ethermine.org/miners/XXXXXXX
SLACK_CH=XXXXXXX
wget $ETH_POOL_URL -O - 2>/dev/null \
| w3m -dump -cols 2000 -T 'text/html' \
| grep -E 'Unpaid Balance.*ETH' \
| slack-cli -d $SLACK_CH
View kusa.js
'use strict'
const svg = (width, height, opts, f) => {
return tag('svg', Object.assign(
{},
{width: `${width}px`, height: `${height}px`},
opts
), f)
}
View get_nichibi_chinese.sh
#!/bin/bash
BASE_URL='http://www.nichibi-chinese.com'
LIST_URL='http://www.nichibi-chinese.com/web-lesson'
LIST=$(curl ${LIST_URL} \
| egrep '<li class=\"page_item page-item-\d*\">' \
| gsed 's/.*<a href=\"\(.*\)\">\(.*\)<\/a><\/li>.*/\1,\2/' \
| gsed 's/\s\+/_/g' \
| grep -v '%' \
View model_format.rb
module ModelFormat
#fields = [
# ["column1", :method1],
# ["column2", :method2],
# ["column3", [:method3_1, :method3_2]],
#]
def define_csv(fields)
define_method :to_csv do
headers, columns = fields.transpose
View field_alias.rb
module FieldAlias
#列挙タイプのエイリアス定義
#ex define_alias_enum(:original, :alias, {0 => "NG", 1 => "OK", nil => "-", other: "不明"})
###from
#def receipt_status
# case receipt
# when 0
# "-"
# when 1
View aaaaa
this file is test.