Skip to content

Instantly share code, notes, and snippets.

@mtalcott
mtalcott / 0_reuse_code.js
Created May 16, 2016 17:39
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mtalcott
mtalcott / results.md
Created May 21, 2015 00:28
wkthmltopdf 0.12.2.1 page-break rule issues with floating parent elements
@mtalcott
mtalcott / results.md
Last active December 9, 2016 04:39
wkhtmltopdf ContentNotFoundError

wkhtmltopdf has very different behavior when certain resources fail to load, which depends on the URL of the resource.

Simply changing the URL of the failed resource changes the exit code of wkhtmltopdf. Certain URLs cause a ContentNotFoundError with an exit code of 1, and others are ignored with an exit code of 0.

All of these tests seem like they should have at least the same exit code.

Tested with wkhtmltopdf 0.12.2.1 (with patched qt).

test1

wkhtmltopdf test1.html test1.pdf

ruby-1.9.3-p448 cumulative performance patch for rbenv

(I guarantee nothing. No warranty I am not responsible blah blah blah. Seems to work great for me so far. Thanks to Tyler Bird who I forked this from.)

This installs a patched ruby 1.9.3-p448 with the railsexpress patchsets: https://github.com/skaes/rvm-patchsets

Requirements

employee_plans = employee_plans.joins(:review_set).includes(
:review_set => [:position, {:employee => :contact, :manager => :contact}]
)
@mtalcott
mtalcott / .pryrc
Created April 12, 2012 17:21
awesome_print integration with pry
# use awesome print for all objects in pry
Pry.config.print = proc { |output, value| output.puts value.ai }
@mtalcott
mtalcott / gist:2287210
Created April 2, 2012 21:08
git-diffcm
#!/bin/sh
echo "\033[36mCommits in $1 not in $2:"; echo
GIT_PAGER=cat git log "$2..$1" --relative-date
echo; echo "\033[36mCommits in $2 not in $1:"; echo
GIT_PAGER=cat git log "$1..$2" --relative-date