Skip to content

Instantly share code, notes, and snippets.

View fukayatsu's full-sized avatar
🏠
Working from home

Atsuo Fukaya fukayatsu

🏠
Working from home
View GitHub Profile
@fukayatsu
fukayatsu / vscode_fix.json
Last active December 8, 2021 19:20
Fix "Cmd+[" / "Cmd+Shift+[" on M1 Mac
{
"title":"VSCode Fix",
"rules":[
{
"description":"Fix Cmd+[",
"_comment":"https://github.com/microsoft/vscode/issues/115651",
"manipulators":[
{
"conditions":[
{
#include <M5StickC.h>
#include <WiFi.h>
#include <HTTPClient.h>
#define REMO_API_URL "https://api.nature.global/1/appliances"
#define REMO_AUTH "Bearer ***"
#define WIFI_SSID "***"
#define WIFI_PASSWORD "***"
HTTPClient http;
@fukayatsu
fukayatsu / fetch_all_posts.rb
Created April 9, 2020 07:48
Fetch all posts in the team using esa-ruby
require 'esa'
client = Esa::Client.new(access_token: "***", current_team: 'foo')
since_number = 0
loop do
posts = client.posts(q: "sort:number-asc number:>#{since_number}", per_page: 100).body['posts']
break if posts.empty?
puts "number: #{posts.first['number']}~#{posts.last['number']}"
@fukayatsu
fukayatsu / script.js
Last active December 9, 2019 01:01
UserScript: macOS Catalina Chrome v78-79 Hiragino Font Fix
// ==UserScript==
// @name macOS Catalina Chrome v78-79 Hiragino Font Fix
// @namespace http://tampermonkey.net/
// @version 0.2
// @description This will no longer be needed after chrome v80.
// @author fukayatsu
// @match http://*/*
// @match https://*/*
// @grant GM_addStyle
// @run-at document-idle
@fukayatsu
fukayatsu / karabiner.json
Last active November 23, 2019 05:37
Karabiner-Elements設定
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
@fukayatsu
fukayatsu / DEBUG_RESOLVER=1 bundle update -VV
Last active May 18, 2017 04:08
Gemfile causes infinite loop with bundler
...
Creating possibility state for rack (~> 1.0) (3 remaining)
Attempting to activate rack (1.1.0)
Found existing spec (rack (2.0.3))
Unsatisfied by existing spec (rack (2.0.3))
Unwinding for conflict: rack (~> 1.0) to 22
Creating possibility state for rack (~> 1.0) (2 remaining)
Attempting to activate rack (1.0.1)
Found existing spec (rack (2.0.3))
@fukayatsu
fukayatsu / init.lua
Last active September 6, 2020 20:48
Hammerspoon config
-- Config for https://github.com/Hammerspoon/hammerspoon
local function keyStroke(mod, key)
return function() hs.eventtap.keyStroke(mod, key) end
end
local function remap(appName, mod1, key1, mod2, key2)
if (not appName) then
return hs.hotkey.bind(mod1, key1, keyStroke(mod2, key2))
end
@fukayatsu
fukayatsu / bookmarklet.js
Last active September 20, 2016 15:35
今日発売のkindleコミック一覧ページを開くブックマークレット
javascript:(function(){var d=new Date();d.setMinutes(-d.getTimezoneOffset());window.open('https://www.amazon.co.jp/s/?rh=n:2293143051,p_n_date:'+d.toISOString().slice(0,10).replace(/-/g,""))})()
@fukayatsu
fukayatsu / default.rb
Created December 24, 2015 04:31
デフォルトの処理を上の方に持ってきたいけど例外処理使えでFAかもしれない
# 1. if not (unless)
if foo != bar
# irregular case
else
# default case
# 2. case
case
when foo != bar
# irregular case
@fukayatsu
fukayatsu / init.coffee
Last active November 7, 2015 09:53
atomのterminal-plusでfocusをいい感じにtoggleするやつ
focusMain = (e) ->
atom.workspace.getActivePane().activate()
for panel in atom.workspace.getBottomPanels()
if panel.item[0]?.className == 'terminal-plus terminal-view'
panel.item.terminal?.blur()
focusTerminal = (e) ->
terminalFound = false
for panel in atom.workspace.getBottomPanels()
if panel.item[0]?.className == 'terminal-plus terminal-view'