Skip to content

Instantly share code, notes, and snippets.

View iberianpig's full-sized avatar

Kohei Yamada iberianpig

View GitHub Profile
@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 / 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
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 / 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

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
@iberianpig
iberianpig / qdbus_windows.sh
Created February 19, 2020 16:37
get running apps info
#!/bin/bash
get_window_paths()
{
qdbus org.ayatana.bamf /org/ayatana/bamf/matcher org.ayatana.bamf.matcher.WindowPaths
}
get_running_apps()
{
qdbus org.ayatana.bamf /org/ayatana/bamf/matcher org.ayatana.bamf.matcher.RunningApplications
@iberianpig
iberianpig / makef.sh
Last active March 15, 2019 07:22
`makef` override original ./Makefile with $MAKEF_PATH
function makef() {
make -f "$(makef_path)" "$@"
}
_makef()
{
COMPREPLY=( $(compgen -W "$(grep -oE '^[a-zA-Z0-9_-]+:([^=]|$)' "$(makef_path)" | sed 's/[^a-zA-Z0-9_.-]*$//')" $2) )
}
complete -F _makef makef
@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 / logind.conf
Created May 7, 2018 05:38
/etc/systemd/logind.conf for hibernate XPS-13-9360 4.10.0-35-generic #39~16.04.1-Ubuntu SMP Wed Sep 13 09:02:42 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.