Skip to content

Instantly share code, notes, and snippets.

View akuhn's full-sized avatar

Adrian Kuhn akuhn

  • Command-line
View GitHub Profile
# My patches for ipdb debugger.
#
# - Use file history
# - Magic lambda expressions
# - Safe assignments (avoid collision with commands)
# - Print assignments
# - ls command (a better dir)
# - dollar command (a better pinfo)
# - fix debug command
#
@akuhn
akuhn / tumblr.rb
Last active December 4, 2018 08:00
Download photos from tumbler blog.
require 'json'
require 'net/http'
require 'nokogiri'
require 'omakase' # see omakase repo on my github
require 'pry'
require 'sqlite3'
API_KEY = JSON.parse(File.read('key_tumblr.json'))['key']
@akuhn
akuhn / gmail.css
Last active September 25, 2018 09:07
/*************
/
/ Install Stylus to use this file in Chrome
\
\
*/
/* Email body */
.a3s {
font: 25.6px Serif !important;
from contrib import debug
# Defines a little language for schema-enforced models.
#
# - Entities are described by models
# - Models are described by metamodels
# - Models have fields, derived fields and constraints
# - Entities can have custom fields
# - Entities can be created even if data is invalid
# To make exit work as expected link PYTHONSTARTUP to this file
type(exit).__repr__ = type(exit).__call__
@akuhn
akuhn / debug.py
Last active March 31, 2018 18:59
# Import this module into your script to enable debugging.
# Set a function breakpoint.
#
# class.method = debug.wrap(class.method)
#
def wrap(function):
def wrapper(*args, **quarks):
set_trace_with_lazy_import_of_libraries(up=2)
// ==UserScript==
// @name Github simplified diffs
// @namespace example
// @include https://git.musta.ch/*
// @include https://gist.git.musta.ch/*
// @include https://github.com/*
// @include https://gist.github.com/*
// @version 1.2
// @grant none
// ==/UserScript==
// ==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})`;
// ==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 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; }');