Skip to content

Instantly share code, notes, and snippets.

View rjlynch's full-sized avatar
👍

Richard Lynch rjlynch

👍
View GitHub Profile
# mac version
# swap panes round ctrl+b o (hold cntrl)
setw -g mode-keys vi
unbind-key j
bind-key j select-pane -D
unbind-key k
bind-key k select-pane -U
unbind-key h
bind-key h select-pane -L
unbind-key l
@rjlynch
rjlynch / README.md
Last active July 1, 2019 19:22
wallpaper switcher macos
[7] pry(main)> Bookings::PlacementDate.new({ 'date(1)' => '2019', 'date(2)' => '9', 'date(3)' => '31' })
=> #<Bookings::PlacementDate:0x00007f842b73e680 id: nil, date: Tue, 01 Oct 2019, created_at: nil, updated_at: nil, duration: 1, active: true, bookings_school_id: nil>
@rjlynch
rjlynch / party-gif.sh
Created September 30, 2018 19:40
party gif maker
#! /usr/bin/env bash
function colour () {
local inFile=$1
local inname=$(basename ${inFile} | cut -d '.' -f1)
local extension=$(echo $inFile | rev | cut -d '.' -f1 | rev)
local brightness=100
local sturation=100
if [ $# -eq 1 ]
then
@rjlynch
rjlynch / .tmux.conf
Last active August 30, 2018 10:01
dotfiles
# mac version
# swap panes round ctrl+b o (hold cntrl)
setw -g mode-keys vi
unbind-key j
bind-key j select-pane -D
unbind-key k
bind-key k select-pane -U
unbind-key h
bind-key h select-pane -L
unbind-key l
@rjlynch
rjlynch / tmux.conf
Last active March 6, 2018 08:47
tmux
# swap panes round ctrl+b o (hold cntrl)
setw -g mode-keys vi
unbind-key j
bind-key j select-pane -D
unbind-key k
bind-key k select-pane -U
unbind-key h
bind-key h select-pane -L
unbind-key l
bind-key l select-pane -R
@rjlynch
rjlynch / event_handler.rb
Last active July 1, 2019 19:28
event handler
class EventHandler
attr_accessor :some_error,
:some_compelted_task,
:something_else
def initialize
instance_variables.each do |symbol|
instance_varialbe_set(symbol, proc {})
end
end
@rjlynch
rjlynch / inspected_rails_object_to_hash.rb
Last active December 1, 2017 22:46
inspected_rails_object_to_hash.rb
target = '#<Workout id: 9, name: "FFF", created_at: "2017-07-08 22:49:20", updated_at: "2017-07-08 22:49:20", date: "2017-07-08 00:00:00", user_id: 1>'
captures = target.scan /\s(\w+):(?:\s"|\s)(.*?)(?=(?:",\s|,\s|">$|>$))/ #=> [["id", "9"], ["name", "FFF"], ["created_at", "2017-07-08 22:49:20"], ["updated_at", "2017-07-08 22:49:20"], ["date", "2017-07-08 00:00:00"], ["user_id", "1"]]
Hash[captures] #=> {"id"=>"9", "name"=>"FFF", "created_at"=>"2017-07-08 22:49:20", "updated_at"=>"2017-07-08 22:49:20", "date"=>"2017-07-08 00:00:00", "user_id"=>"1"}
# Regex break down
# a space followed by one or more words, that we capture
# followed by a colon
# followed by a space and quote or just a space, neither of which we capture
# followed by zero or more of any character, which we capture
# upto one of the following sequences, that we dont capture;
@rjlynch
rjlynch / .screenrc
Created October 26, 2017 13:04
screenrc
caption always "%{=b dw}:%{-b dw}:%{=b dk}[ %{-b dw}%{-b dg}$USER%{-b dw}@%{-b dg}%H %{=b dk}] [ %= %?%{-b dg}%-Lw%?%{+b dk}(%{+b dw}%n:%t%{+b dk})%?(%u)%?%{-b dw}%?%{-b dg}%+Lw%? %{=b dk}]%{-b dw}:%{+b dw}:"
hardstatus alwayslastline "%{+b dw}:%{-b dw}:%{+b dk}[%{-b dg} %0C:%s%a %{=b dk}]-[ %{-b dw}Load%{+b dk}:%{-b dg}%l %{+b dk}] [%{-b dg}%2`%{+b dk}] %=[ %{-b dg}%1`%{=b dk} ]%{-b dw}:%{+b dw}:%<"
" Name: hydrangea.vim --- Hydrangea theme for Vim
" Author: Yuta Taniguchi <yuta.taniguchi.y.t@gmail.com>
" URL: https://github.com/yuttie/hydrangea-vim
" Version: 4.1.0
" License: MIT License
hi clear
if exists('syntax_on')
syntax reset
endif