Skip to content

Instantly share code, notes, and snippets.

View yvon's full-sized avatar

Yvon Cognard yvon

  • Drivencode
  • Paris, France
View GitHub Profile
@yvon
yvon / post-checkout
Created December 14, 2011 17:36
Git post-checkout hook changing database.yml
#!/usr/bin/env ruby
require 'fileutils'
# Change working directory to repository
Dir.chdir(File.join(File.dirname(__FILE__), '..', '..'))
branch = `git branch | grep '*' | cut -c 3-`.chomp
new_db_config_file = File.join('config', "database.#{branch}.yml")
@yvon
yvon / rc.lua
Created December 15, 2011 11:43
Awesome (window manager) configuration opening terminal in focused client working directory
awful.key({ modkey, }, "Return",
function ()
pid = client.focus.pid
cpid = string.gsub(awful.util.pread('pgrep -P ' .. pid), "[\r\n]+$", "")
cwd = string.gsub(awful.util.pread('readlink /proc/' .. cpid .. '/cwd'), "[\r\n]+$", "")
if string.len(cwd) > 0 then
awful.util.spawn(terminal .. ' -cd ' .. cwd)
else
awful.util.spawn(terminal)
end
@yvon
yvon / CONFIGURE THINKPAD USB KEYBOARD.md
Last active August 23, 2018 07:56
Automatically configure trackpoint speed of Lenovo ThinkPad Compact USB Keyboard when plugged in

Automatically configure trackpoint speed of Lenovo ThinkPad Compact USB Keyboard when plugged in.

  1. Install and enable atd service

  2. Add an udev rule. /ect/udev/rules.d/10-trackpoint.rules:

ACTION=="add", ATTR{idVendor}=="17ef", ATTR{idProduct}=="6047", RUN+="/home/yvon/configure-lenovo-thinkpad-usb-keyboard-trackpoint/udev-receiver.sh"
@yvon
yvon / encode.sh
Created August 13, 2021 07:46
Encode iRacing multiple angle videos (cockpit mirror and tv) into one
#!/usr/bin/env bash
output_folder=$1
output=output.mp4
transition=hblur
duration=0.5
cd `dirname $0`
sources=()