Skip to content

Instantly share code, notes, and snippets.

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

Chikara Saito csnagu

🏠
Working from home
View GitHub Profile
@csnagu
csnagu / init.lua
Created March 25, 2024 11:43
hammerspoon configuration
hs.loadSpoon("ShiftIt")
spoon.ShiftIt:bindHotkeys({});
mod = { 'option', 'shift', 'command' }
mod2 = { 'option', 'shift', 'command', 'ctrl' }
mod3 = { 'option', 'shift', 'control' }
hs.window.animationDuration = 0.3
format = """
$username\
$hostname\
$directory\
$git_branch\
$git_state\
$git_status\
$cmd_duration\
$line_break\
$python\
@csnagu
csnagu / setup.scpt
Created August 15, 2023 00:07
macでコンテキストに応じたデスクトップレイアウトを準備してくれるAppleScript
tell application "Terminal"
activate
do script "code ~/path/to/workspace"
delay 2
quit
end tell
arrangeWindow(124) -- 124: right arrow
tell application "Google Chrome"
make new window
members = ['Alice', 'Bob', 'Charlie', 'Dave', 'Eve', 'Frank']
roles = ['Role A', 'Role B', 'Role C', 'Role D', 'Role E']
# 開始日を木曜日に設定
start_date = "2023-03-23"
# マークダウンのテーブル形式でローテーション表を表示
print("| Roles |", end="")
for member in members:
print(f" {member} |", end="")
@csnagu
csnagu / .vimrc
Created September 11, 2022 23:52
vimrc
" ref: https://qiita.com/morikooooo/items/9fd41bcd8d1ce9170301
" setting
"文字コードをUFT-8に設定
"set fenc=utf-8
set encoding=utf-8
" バックアップファイルを作らない
set nobackup
" スワップファイルを作らない
set noswapfile
@csnagu
csnagu / .zshrc
Created September 11, 2022 23:51
zshrc
# 補完
if type brew &>/dev/null; then
FPATH=$(brew --prefix)/share/zsh-completions:$FPATH
# FOR DOCKER - http://docs.docker.jp/compose/completion.html
fpath=(~/.zsh/completion $fpath)
autoload -Uz compinit
compinit
fi
@csnagu
csnagu / mySettingKey.ahk
Last active June 26, 2021 07:55
MacOSのカーソル移動系キーバインドを再現するautoHotKeyのコンフィグファイル
IME_SET(SetSts, WinTitle="A") {
ControlGet,hwnd,HWND,,,%WinTitle%
if (WinActive(WinTitle)) {
ptrSize := !A_PtrSize ? 4 : A_PtrSize
VarSetCapacity(stGTI, cbSize:=4+4+(PtrSize*6)+16, 0)
NumPut(cbSize, stGTI, 0, "UInt") ; DWORD cbSize;
hwnd := DllCall("GetGUIThreadInfo", Uint,0, Uint,&stGTI)
? NumGet(stGTI,8+PtrSize,"UInt") : hwnd
}
@csnagu
csnagu / todoist2trello.py
Last active October 11, 2020 00:28
todoistの `project_id` にあるタスクをtrelloに登録する
import json
import os
import re
import sys
import requests
trello_querystring_template = {
"key": os.getenv("TRELLO_KEY"),
"token": os.getenv("TRELLO_TOKEN")
@csnagu
csnagu / webhookTodoistToGoogleSpreadsheet.gs
Created January 26, 2020 06:09
This script is called when I complete tasks on Todoist, and writes Todoist's completed task to google spreadsheet by IFTTT's webhook.
// ref: https://internetthingy.com/todoist-ifttt-gas-63.html
function doPost(e) {
//Todoist->IFTTTからwebhook->GASで受け取るスクリプト
//データはjson形式で受け取り
var data = JSON.parse(e.postData.getDataAsString());
//IFTTTはjsonを3項目までしか出力できないので、タスク名、時間関係データ、それ以外のデータの3項目にした。
var TaskContent = data.TaskContent;
var CompletedAt = data.CompletedAt;
var options = data.options;