Skip to content

Instantly share code, notes, and snippets.

@watr
watr / cmd2ctr_cmd-ime_kana-layout.ahk
Last active February 28, 2021 04:06
Mac US keyboard key remapping for Windows with Kana input style
#Include IME.ahk
CapsLock::Ctrl
LWin::LCtrl
RWin::RCtrl
/*
;;;;;;;; Inspired by https://github.com/karakaram/alt-ime-ahk
*/
; 主要なキーを HotKey に設定し、何もせずパススルーする
@watr
watr / setup-macos.md
Last active June 28, 2019 18:43
macOS 10.15 Setup (Clean Install)
  • (Apple ID でログインする)
  • トラックパッド
    • "システム環境設定"を開く
      • トラックパッド
        • ポイントとクリック
          • "タップでクリック" を有効化
          • "サイレントクリック" を有効化
        • そのほかのジェスチャ
          • "アプリケーション Exposé" を有効化
  • アクセシビリティ
@watr
watr / orde29unes.swift
Last active December 9, 2018 07:36
横浜へなちょこプログラミング勉強会 #yhpg https://yhpg.doorkeeper.jp/ アンエスケープ 2018.12.8 http://nabetani.sakura.ne.jp/hena/orde29unes/ をSwift(4.2)で解いた
// 横浜へなちょこプログラミング勉強会 | Doorkeeper
// https://yhpg.doorkeeper.jp/
//
// アンエスケープ 2018.12.8
// http://nabetani.sakura.ne.jp/hena/orde29unes/
import Foundation
var tested_count = 0
var ok_count = 0
var ng_count = 0
@watr
watr / doukaku.swift
Last active September 6, 2018 10:48
オフラインどう書くの課題を Swift で解くときの雛形
// 横浜へなちょこプログラミング勉強会 | Doorkeeper
// https://yhpg.doorkeeper.jp/
import Foundation
var test_count = 0
var ok_count = 0
var ng_count = 0
func solve(input: String) -> String {
@watr
watr / ordf07walk.swift
Created October 25, 2017 10:35
ordf07walk.swift
import Foundation
struct TestCase: CustomStringConvertible {
var input: String
var expectedOutput: String
var description: String {
return String("input: \(self.input), expected output: \(self.expectedOutput)\n")
}
//: Playground - noun: a place where people can play
import Foundation
var testCases: [(input: String, expectedOutput: String)] = []
func addTestCase(_ input: String, _ expectedOutput: String) {
testCases.append((input, expectedOutput))
}
@watr
watr / find-xib-use-autolayout.sh
Created December 13, 2016 07:34
print .xib files which using auto layout
#!/bin/sh
## usase: $ sh ./find-xib-use-autolayout.sh <path_to_search_directoty>
path_to_search_directoty="$1"
cd "$path_to_search_directoty"
function document_uses_autolayout () {
# $1: file path
matched_text=`grep -H -i -e 'useAutolayout="YES"' -e 'key="IBDocument.UseAutolayout">YES' "$1"`
@watr
watr / macos-deployment-target.sh
Last active December 13, 2016 07:15
print macOS binary's deployment target
#!/bin/sh
## usase: $ sh ./macos-deployment-targer.sh <path-to-binary>
path_to_binary="$1"
otool -lv "$path_to_binary" | grep -A 3 LC_VERSION_MIN_MACOSX | grep "version" | awk '{print $2;}'