Skip to content

Instantly share code, notes, and snippets.

View darkhelmet's full-sized avatar
🏠
Working from home

Daniel Huckstep darkhelmet

🏠
Working from home
View GitHub Profile
(function($) {
$.fn.swfembed = function(movie, width, height) {
this.each(function() {
scale = 600 / width;
w = '600px';
h = (height * scale) + 'px';
swfobject.embedSWF(movie, this.id, w, h, '9.0.124', '/swf/expressInstall.swf', null, { wmode: 'opaque', allowFullscreen: true });
});
}
})(jQuery);
@darkhelmet
darkhelmet / iterator.rb
Created November 16, 2009 04:46 — forked from tmm1/iterator.rb
module EventMachine
# A simple iterator for concurrent asynchronous work.
#
# Unlike ruby's built-in iterators, the end of the current iteration cycle is signaled manually,
# instead of happening automatically after the yielded block finishes executing. For example:
#
# (0..10).each{ |num| }
#
# becomes:
#
module HTML
class StathamSanitizer < WhiteListSanitizer
protected
def tokenize(text, options)
super.map do |token|
if token.is_a?(HTML::Tag) && options[:parent].include?(token.name)
token.to_s.gsub(/</, "&lt;")
else
Problem 1: I see your point and agree. The 12 pixel space isn't present on XP (I think), as a side note. (EDIT: When you fullscreen it, there is no space. When it's not, the space is there...)
Problem 2: I <3 the Omnibar. I like having one keyboard shortcut to go to on place to do everything. But that's me. You don't like it so it's clearly not for everybody. I can't think of a good solution ATM.
Problem 3: I like that it's only visible when it's relevant, like when you are hovering over a link, etc.
I find Chrome tends to get out of my way more than other browsers. It makes the web(site) more central, instead of the browser which happens to be displaying a webpage.
My 2 cents.
#!/usr/bin/env ruby
require 'rubygems'
require 'aws/s3'
S3_CREDENTIALS = File.expand_path(File.join('~', '.s3', 'auth.yml'))
APP = 'darkblog'
BUCKET = 's3.blog.darkhax.com'
def bundle
require 'open-uri'
# url dsl -- the ultimate url dsl!
#
# You just can't beat this:
#
# $ irb -r url_dsl
# >> include URLDSL
# => Object
# >> http://github.com/defunkt.json
class Foo
def initialize(a, business = 1, charlie = 2)
@a = a
@business = business
@charlie = charlie
end
def bar
# do stuff
@a = 1 + 1
<div id='REPLACE-ME-video' class='swfembed' movie='URL' mheight='HEIGHT' mwidth='WIDTH'>Witty comment about needing Javascript goes here...</div>
[error]: NoMethodError: undefined method `callcc' for #<YARD::Handlers::Ruby::Legacy::ModuleHandler:0x103706648>
[error]: Stack trace:
/Users/darkhelmet/local/ree/lib/ruby/gems/1.8/gems/yard-0.5.2/lib/yard/handlers/base.rb:346:in `ensure_loaded!'
/Users/darkhelmet/local/ree/lib/ruby/gems/1.8/gems/yard-0.5.2/lib/yard/handlers/base.rb:296:in `register'
/Users/darkhelmet/local/ree/lib/ruby/gems/1.8/gems/yard-0.5.2/lib/yard/handlers/base.rb:292:in `each'
/Users/darkhelmet/local/ree/lib/ruby/gems/1.8/gems/yard-0.5.2/lib/yard/handlers/base.rb:292:in `register'
/Users/darkhelmet/local/ree/lib/ruby/gems/1.8/gems/yard-0.5.2/lib/yard/handlers/ruby/legacy/module_handler.rb:6:in `process'
/Users/darkhelmet/local/ree/lib/ruby/gems/1.8/gems/yard-0.5.2/lib/yard/handlers/processor.rb:71:in `process'
require 'snip_snap'
require 'hpricot'
module Rack
# = Rack::Snapshot
#
# Takes the image tags in your page and expands them using some of the popular
# image sharing services. Currently supports these services:
#