Skip to content

Instantly share code, notes, and snippets.

View akuhn's full-sized avatar

Adrian Kuhn akuhn

  • Command-line
View GitHub Profile
// ==UserScript==
// @name Github Praise
// @namespace example
// @include https://git.musta.ch/*
// @include https://github.com/*
// @version 1.2
// @grant GM_addStyle
// ==/UserScript==
GM_addStyle('.line-age { padding: 0px 12px !important; }');
[alias]
d = "!cd ${GIT_PREFIX:-.} && git diff && [[ -z \"$(git diff)\" ]] && git diff --staged && [[ -z \"$(git diff --staged)\" ]] && git log -p master.."
l = "!cd ${GIT_PREFIX:-.} && if [[ -z \"$(git diff --name-only && git diff --name-only --staged)\" ]]; then git log --stat master..; else git status; fi"
book = bookmark
drop = stash save 'dropping local changes'
touch = "!GIT_COMMITTER_DATE=\"`date`\" git commit --amend --date \"`date`\""
wip = stash save 'work in progress'
[color]
ui = auto
[core]
require 'active_record'
require 'colorize'
require 'pry'
class Eigenlogger
def debug?
true
end
def debug(message)
message.uncolorize =~ /^ (.*?) (.*)$/
// ==UserScript==
// @name Github Large Emoji
// @namespace example
// @include https://github.com/*
// @version 1.0
// @grant GM_addStyle
// ==/UserScript==
GM_addStyle('img.emoji { width: 64px; height: 64px }');
# Maps a Rails route to a dynamic action name using interpolation.
#
# get 'experiments/ajax/:endpoint', to: dynamic('experiments#ajax_%{endpoint}')
class Dynamic
def initialize(to)
@to = to
end
def call(env)
params = env['action_dispatch.request.path_parameters']
@akuhn
akuhn / .pryrc
Last active December 23, 2016 00:30
if defined? PryDebugger
Pry.commands.alias_command 'c', 'continue'
Pry.commands.alias_command 'f', 'finish'
Pry.commands.alias_command 'n', 'next'
Pry.commands.alias_command 's', 'step'
end
def __objects__(filter)
GC.disable
enum = ObjectSpace.each_object(filter)
// ==UserScript==
// @name Readable emails
// @namespace http://example.com
// @author [email protected]
// @match https://mail.google.com/*
// @version 1.0
// @grant GM_addStyle
// ==/UserScript==
GM_addStyle('.ii { font: 160% Serif !important; }');
// ==UserScript==
// @name Pokemon meme for inbox zero
// @namespace http://example.com
// @author You
// @match https://mail.google.com/*
// @version 1.1
// @grant GM_addStyle
// ==/UserScript==
GM_addStyle('tr.TD td.my_congratulations { font: 25.6px Serif; padding: 8px 0 36px 0; }');
// ==UserScript==
// @name Show emoji in gmail
// @namespace http://example.com
// @author You
// @match https://mail.google.com/*
// @version 1.0
// @grant GM_addStyle
// ==/UserScript==
var installed = false;
// ==UserScript==
// @name Readable documents
// @namespace example
// @include https://airbnb.quip.com/*
// @version 1.0
// @grant GM_addStyle
// ==/UserScript==
function transformation(match, p1) {
return `calc(1.33333333333 * ${p1})`;