Skip to content

Instantly share code, notes, and snippets.

@matsuoshi
matsuoshi / gist:933ffd57e22dbbe4b199916fc309b4de
Last active September 28, 2024 01:06
xremap config (emacs like control-key)
modmap:
- name: modifiers
remap:
CapsLock: RightCtrl
Muhenkan:
held: LeftCtrl
alone: Muhenkan
keymap:
- name: Terminal
@matsuoshi
matsuoshi / regex.php
Created September 27, 2022 10:49
正規表現の uフラグ
<?php
$subjects = [
'zenkaku',
'hankaku',
'あいうえお'
];
foreach ($subjects as $subject) {
preg_match('/^[a-z]+$/', $subject, $match);
var_dump($match);
{
"title": "Japanese JIS to US Keyboard: Remap Symbol Keys",
"maintainers": [
"halfwhole"
],
"rules": [
{
"description": "Japanese JIS to US Keyboard: Remap Symbol Keys",
"manipulators": [
{
# from to
1 右space 無変換
2 無変換 WIN
3 WIN App
4 Caps L_CTRL
5 fn + Caps L_CTRL
6 FN L_CTRL
@matsuoshi
matsuoshi / eisuu-command.json
Last active July 14, 2022 01:12
karabiner, Eisuu to Command
{
"title": "Cmd-Eisuu-Kana",
"rules": [
{
"description": "cmd to eisuu and kana",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_command",
@matsuoshi
matsuoshi / kensington-trackball.json
Last active June 21, 2022 03:02
Karabiner setting, for Kensington Trackball
{
"title": "for Kensington Trackball",
"rules": [
{
"description": "L_btn + R_btn to Button 2",
"manipulators": [
{
"type": "basic",
"from": {
"simultaneous": [
@matsuoshi
matsuoshi / .htaccess
Created February 3, 2019 02:14
Facebook / Twitter からのクロールを、BASIC認証下でも許可する
# FB / twitterクローラーを許可する
Satisfy Any
Order Allow,deny
SetEnvIf User-Agent "^facebookexternalhit.*$" sns_crawler
SetEnvIf User-Agent "^.*Twitterbot.*$" sns_crawler
Allow from env=sns_crawler
@matsuoshi
matsuoshi / browser.json
Created January 24, 2019 05:49
karabiner-elements setting: F5 to CMD+R key (browser only)
{
"title": "browser",
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"^com\\.apple\\.Safari",
"^com\\.google\\.Chrome",
"^com\\.vivaldi\\.Vivaldi"
]
@matsuoshi
matsuoshi / backslash.json
Created December 19, 2018 11:56
underscore to backslash with Karabiner-Elements
{
"title": "backslash",
"rules": [
{
"description": "underscore to backslash",
"manipulators": [
{
"from": {
"key_code": "international1"
},
@matsuoshi
matsuoshi / eisu-hjkl.json
Last active December 3, 2018 02:23
英数+hjkl でカーソル移動 with Karabiner-Elements https://blog.monaural.net/post/hjkl-to-cursor-key-with-karabiner-elements/
{
"title": "Eisu Cursor",
"rules": [
{
"description": "Change EISU + hjkl to arrow keys",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "japanese_eisuu"