Skip to content

Instantly share code, notes, and snippets.

View justincase's full-sized avatar

Justin Case justincase

View GitHub Profile
@justincase
justincase / net-http-debug.rb
Created September 17, 2019 18:37 — forked from ahoward/net-http-debug.rb
a simple way to debug tons of libs that use ruby's net/http
BEGIN {
require 'net/http'
Net::HTTP.module_eval do
alias_method '__initialize__', 'initialize'
def initialize(*args,&block)
__initialize__(*args, &block)
@justincase
justincase / list.md
Last active April 6, 2017 18:23
List of PDF Producers found in the wild

PDF Producers

  • Acrobat Distiller 9.3.2 (Windows)
  • Adobe LiveCycle Designer ES 8.2
  • Adobe PDF Library 7.0
  • Apache FOP Version 1.0
  • Crystal Reports
  • EvoPdf HTML to PDF Converter 2.2
  • FPDF 1.6
  • FPDF 1.7
@justincase
justincase / gfm.rb
Created June 12, 2013 00:28 — forked from mojombo/gfm.rb
require 'digest/md5'
def gfm(text)
# Extract pre blocks
extractions = {}
text.gsub!(%r{<pre>.*?</pre>}m) do |match|
md5 = Digest::MD5.hexdigest(match)
extractions[md5] = match
"{gfm-extraction-#{md5}}"
end

GitHub Javascript Strategy

Unless otherwise necessary (such as mobile development), the GitHub javascript codebase is based off jQuery. You can safely assume it will be included on every page.

File naming

  • All jquery plugins should be prefixed with jquery, such as jquery.facebox
  • All github-specific jquery plugins should be prefixed with jquery.github. Like jquery.github.repo_list.js
  • All page-specific files (that only run on ONE page) should be prefixed with page. page.billing.js
@justincase
justincase / Result
Created December 31, 2008 05:35 — forked from flavorjones/Result
XML Document parsing benchmark
user system total real
hpricot:xml:doc 10.160000 0.950000 11.110000 ( 11.144462)
hpricot2:xml:doc 0.950000 0.000000 0.950000 ( 0.953266)
nokogiri:compat:doc 0.220000 0.020000 0.240000 ( 0.238401)
nokogiri:xml:doc 0.170000 0.030000 0.200000 ( 0.200283)
XML XPath benchmarks (//status/text, //user/name)
user system total real
hpricot:xml:xpath 7.580000 1.150000 8.730000 ( 8.728314)