Skip to content

Instantly share code, notes, and snippets.

View iberianpig's full-sized avatar

Kohei Yamada iberianpig

View GitHub Profile
@iberianpig
iberianpig / commit-msg
Created August 18, 2015 13:06
IssueID_xxxxなブランチ名の時に自動でコミットメッセージの先頭に[#IssueID]を付与するrubyスクリプト
#!/usr/bin/env ruby
message_file = ARGV[0]
message = File.read(message_file, :encoding => Encoding::UTF_8)
# remove prefix issue number like [#1234] from COMMIT_EDITMSG
message = message.sub(/^\[#[0-9A-Za-z_].*\]/, "")
# remove comment
message = message.gsub(/^#(?! ------------------------ >8 ------------------------).*\n|^\n/, "")
@iberianpig
iberianpig / 50-synaptics.conf
Created February 6, 2013 01:45
/etc/X11/xorg.conf.d/50-synaptics.conf
Section "InputClass"
Identifier "evdev touchpad catchall"
Driver "synaptics"
MatchDevicePath "/dev/input/event*"
MatchIsTouchpad "on"
Option "Protocol" "event"
Option "SHMConfig" "on"
###CUSTOMIZE SECTION###
Option "GrabEventDevice" "on"
Option "FingerLow" "10" # touchpad sensitivity
@iberianpig
iberianpig / Gemfile.local
Last active July 26, 2023 10:43
Gemfile.local outside of version control
custom_gemfile = <<~GEMFILE
gem "solargraph", require: false
gem 'solargraph-rails', require: false
# gem 'rails', path: '~/.ghq/github.com/rails/rails'
# gem 'activerecord', path: '~/.ghq/github.com/rails/rails/activerecord'
gem 'actionpack', path: '~/.ghq/github.com/rails/rails/actionpack'
gem 'activesupport', path: '~/.ghq/github.com/rails/rails/activesupport'
gem 'debug'
GEMFILE
@iberianpig
iberianpig / db.rake
Last active July 5, 2023 14:15
lib/tasks/db.rake (mysql_dump/mysql_restore/dump_seed_fu) using ActiveRecord configuration
# ./lib/tasks/db.rake
require 'active_record'
@logger = Logger.new(STDOUT)
namespace :db do
desc "Dumps the database to tmp/dbname.dump"
task mysql_dump: [:environment, :load_config] do
environment = Rails.env
configuration = ActiveRecord::Base.configurations[environment]
@iberianpig
iberianpig / change_finger_count.sh
Last active May 1, 2023 23:20
Change finger count for default gestures in Gnome Wayland (require login/logout after executing this script.)
function gnome-wayland-change-finger-count() {
local finger_count=$1
case "${finger_count}" in
3|4|5)
echo "changing finger count to ${finger_count}"
# check if the file we want to customize is in the gresource list
if gresource list /usr/lib/gnome-shell/libgnome-shell.so | grep -q 'swipetracker.js'; then
# create a folder to hold your custom overlays
mkdir -p ~/.gnome-shell-custom-overlays/ui
@iberianpig
iberianpig / .ideavimrc
Created March 30, 2015 14:23
IdeaVIM用のキーマップ
"検索をファイルの先頭へ循環しない
set nowrapscan
"大文字小文字の区別なし
set ignorecase
"検索時に大文字を含んでいたら大/小を区別
set smartcase
"検索対象をハイライト
namespace :model_from_schema do
desc 'Generate model files from db schema'
task gen: :environment do
module ModelGenerator
Models = {}
module Evaluator
module_function
def create_table(table_name, *)
@iberianpig
iberianpig / mf2_free.rb
Last active April 10, 2021 13:37
MFの交通系ICカードリーダーで取得したCSVをFreeeで取り込める形式に変換する
require 'csv'
class Mf2Freee
FILE_NAME = "収入・支出詳細_2020"
def run
files = Dir.glob("./#{FILE_NAME}*.csv")
file = files.first
raise 'file not found' if file.nil?
## mf ##
@iberianpig
iberianpig / WaylandUbuntu19.10-AppTitle
Created July 26, 2020 14:10 — forked from rbreaves/WaylandUbuntu19.10-AppTitle
Grab wmclass name or Window Name/Title under Wayland with Gnome 3.x
# Single Command, runs 2 calls to gdbus to get the currently active Window from Gnome 3.x
# Escaped so you can copy and paste into terminal directly
gdbus call -e -d org.gnome.Shell -o /org/gnome/Shell -m org.gnome.Shell.Eval global.get_window_actors\(\)[`gdbus call -e -d org.gnome.Shell -o /org/gnome/Shell -m org.gnome.Shell.Eval global.get_window_actors\(\).findIndex\(a\=\>a.meta_window.has_focus\(\)===true\) | cut -d"'" -f 2`].get_meta_window\(\).get_wm_class\(\) | cut -d'"' -f 2
# Unescaped version, will not run
# Broken down into 2 commands.
# Call to Gnome to get the array location of the active Application
gdbus call -e -d org.gnome.Shell -o /org/gnome/Shell -m \
@iberianpig
iberianpig / Makefile
Last active June 22, 2020 09:59
Update ath10k-firmware firmware for XPS 13 9360. git clone https://github.com/kvalo/ath10k-firmware and put Makefile in project root
.PHONY: all
TODAY := $(shell date --rfc-3339 date)
all: help
backup_QCA6174: ## backup
mkdir -p backup/$(TODAY)/
cp -a /lib/firmware/ath10k/QCA6174 backup/$(TODAY)/QCA6174