Skip to content

Instantly share code, notes, and snippets.

View lee-dohm's full-sized avatar
😴
Taking some well-deserved naps

Lee Dohm lee-dohm

😴
Taking some well-deserved naps
View GitHub Profile
@lee-dohm
lee-dohm / frame.el
Last active December 28, 2015 11:08 — forked from ieure/tiling
;; Functions to work with frames
(provide 'ime-frame)
(defun screen-usable-height (&optional display)
"Return the usable height of the display.
Some window-systems have portions of the screen which Emacs
cannot address. This function should return the height of the
screen, minus anything which is not usable."

Capybara Cheat Sheet

Navigating

visit('/projects')
visit(post_comments_path(post))

Clicking Links and Buttons

@lee-dohm
lee-dohm / push_db_to_s3
Last active December 22, 2015 20:39 — forked from david-vo/push_db_to_s3
#!/usr/bin/env ruby
# Script to backup the Discourse postgres db and upload it to Amazon S3
require 'rubygems'
require 'yaml'
require 'fog'
require 'time'
require 'date'
require 'fileutils'
###
# Allowable
#
# A pattern for decomposing large/long conditional chains
# into readable, testable, and inspectable segments.
# Code coverage stats can help show you which conditions
# aren't getting test coverage, and printing/prying around
# the code can show you intermediary condition results.
#
# Effectively a block-syntax for the `or` operator: each `when?`
@lee-dohm
lee-dohm / linktastic.css
Created August 25, 2012 20:23 — forked from psyked/linktastic.css
CSS: Automatic link type icons
a[href^="http:"] {
display:inline-block;
padding-right:14px;
background:transparent url(/Images/ExternalLink.gif) center right no-repeat;
}
a[href^="mailto:"] {
display:inline-block;
padding-left:20px;
line-height:18px;
background:transparent url(/Images/MailTo.gif) center left no-repeat;
@lee-dohm
lee-dohm / rscript.R
Created July 18, 2012 18:57 — forked from ssimeonov/rscript.R
Rscript discovery & reloading
rscript.stack <- function()
{
# Returns the stack of Rscript files.
#
# Returns:
# Stack of files.
Filter(Negate(is.null), lapply(sys.frames(), function(x) x$ofile))
}