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
<!--
{
"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>
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)
class FooMigration < Sequel::Migration
def up
add_column :foos, :bar
Foo.create(:bar => 'baz')
end
end
class AddTimestampsToFoosAndBarsMigration < Sequel::Migration
def up
time_type = defined?(Sequel::Postgres) ? :timetz : :datetime
[:foos, :bars].each do |tab|
add_column tab, :created_at, time_type
add_column tab, :updated_at, time_type
end
Debugger entered--Lisp error: (error "Local variables list is not properly terminated")
signal(error ("Local variables list is not properly terminated"))
error("Local variables list is not properly terminated")
hack-local-variables()
autoload-find-file("elpa-to-submit/find-file-in-project.el")
generate-file-autoloads("elpa-to-submit/find-file-in-project.el")
update-file-autoloads("elpa-to-submit/find-file-in-project.el")
mapcar(update-file-autoloads ("elpa-to-submit/cperl-mode.el" "elpa-to-submit/find-file-in-project.el" "elpa-to-submit/haml-mode.el" "elpa-to-submit$
update-directory-autoloads("/Users/jeffhodges/.emacs.d//elpa-to-submit")
(progn (message "Updating autoloads...") (update-directory-autoloads autoload-dir))