Skip to content

Instantly share code, notes, and snippets.

View jmhodges's full-sized avatar
🐶
return of the

Jeff Hodges jmhodges

🐶
return of the
View GitHub Profile
$ twurl -U '/1.1/users/show.json?screen_name=jmhodges'
{"errors":[{"message":"SSL is required","code":92}]}
@jmhodges
jmhodges / welp.scala
Last active August 29, 2015 13:56
The catch statement doesn't print the text. Seen with scala 2.8.1, 2.9.2 and now 2.10.x.
object Welp {
def foobar(a: Int, b: Int, c:Int) { throw new IllegalArgumentException }
def main(args: Array[String]) {
List(3) map {
try {
foobar(1, 2, _)
} catch {
case e: Throwable => { // This set of braces is optional. Problem remains when removed.
println("won't be printed")
<!--
{
"description": "& test 1",
"expect": {"bozo": false, ["entries", 0, "title_detail", "value"]: "&#38;"]}
}
-->
<feed version="0.3" xmlns="http://purl.org/atom/ns#">
<entry>
<title type="text/html" mode="escaped">&</title>
</entry>
@jmhodges
jmhodges / keybase.md
Created March 13, 2015 00:35
keybase.md

Keybase proof

I hereby claim:

  • I am jmhodges on github.
  • I am jmhodges (https://keybase.io/jmhodges) on keybase.
  • I have a public key whose fingerprint is 8A35 CDF5 3D9F 1A4C 189D 67F6 3A39 B99B 7493 8DA7

To claim this, I am signing this object:

Shoes.app do
stack do
@scrolling_log = stack do
para "Something Cool"
end
flow do
@add = edit_line
button("Add", :margin_left => 5) do
@jmhodges
jmhodges / bloomnames.rb
Created October 20, 2008 01:18
a ruby implementation of BloomNames
require 'digest/sha1'
# Derived from a python implementation by Joe Gregorio:
# http://bitworking.org/news/380/bloom-filter-resources
# A Bloom Filter for tracking 3,000 'names', where 'names' are any
# strings of any length. Can be used to track less than 3,000 names, or more,
# but going over will increase the false positive rate. This is currently
# tuned for a false positive rate of 1%.
#
# This assumes you've already got the stuff from git-completion.bash source'd in.
git_dirty_status ()
{
local gitstat="$(git status 2>/dev/null)"
local dirty="$(echo $gitstat | grep 'added to commit' 2>/dev/null)"
if [ -n "$dirty" ]; then
printf " ⚡"
fi
}
# When run from `rake sequel:db:migrate && rake sequel:db:migrate VERSION=0`
# in a merb app with the sqlite adapter, raises:
# rake aborted!
# SQLite3::SQLException cannot start a transaction within a transaction
class AddFoosMigration < Sequel::Migration
# This is an intentionally bogus migration that demonstrates the problem
# where two would be needed if this was well-written.
def up
create_table :foos do
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(prefer-coding-system 'utf-8)