Skip to content

Instantly share code, notes, and snippets.

View tobi's full-sized avatar

Tobias Lütke tobi

View GitHub Profile
#!/usr/local/bin/ruby -w
require 'rubygems'
require 'inline'
##
# Provides a clean and simple API to generate thumbnails using
# FreeImage as the underlying mechanism.
#
# For more information or if you have build issues with FreeImage, see
tobbook5:delayed_job(master) $ github pull defunkt
Switching to defunkt/master
fatal: protocol error: expected sha/ref, got '
*********'
Permission denied. Repository is not public.
*********'
tobbook5:delayed_job(defunkt/master) $
<?PHP
function compute_key_for_src($src) {
// Replace with your API key
return md5('<YOUR API KEY>'.$src)
}
function screenshot_of($src) {
// Replace with the url to the profile that will take the screenshot
return 'http://www.web2png.com/s/123/frontpage.png?src=$src&key='. compute_key_for_src($src);
require 'digest/md5'
def compute_key_for_src(src)
Digest::MD5.hexdigest('<YOUR API KEY>' + src)
end
def screenshot_of(src)
"http://www.web2png.com/s/123/frontpage.png?src=#{src}&key=#{compute_key_for_src(src}"
end
// ==UserScript==
// @name tasks
// @namespace http://fluidapp.com
// @description Shows pending tasks as badge in fluid and nags by growl every hour or so until you do them all
// @include https://*.highrisehq.com/
// @author Tobi
// ==/UserScript==
(function () {
** [out :: app3] Welcome to the Ruby Enterprise Edition installer
** [out :: app3] This installer will help you install Ruby Enterprise Edition 1.8.6-20081205.
** [out :: app3] Don't worry, none of your system files will be touched if you don't want them
** [out :: app3] to, so there is no risk that things will screw up.
** [out :: app3]
** [out :: app3] You can expect this from the installation process:
** [out :: app3]
** [out :: app3] 1. Ruby Enterprise Edition will be compiled and optimized for speed for this
** [out :: app3] system.
** [out :: app3] 2. Ruby on Rails will be installed for Ruby Enterprise Edition.
# ==================
# After login
# getting all blogs for a drop down:
blogs = ShopifyAPI::Blog.find(:all)
blogs.each do |blog|
blog.id #=> 439432
blog.title #=> "My cool blog"
@tobi
tobi / ci
Created August 5, 2009 20:02
output_directory = ARGV[1]
class TestRunner
class Result < Struct.new(:setup, :test_output, :setup_errorcode, :test_errorcode)
end
def initialize(dir)
[Fri, 14 Aug 2009 17:20:43 -0400] DEBUG: Loading plugin os
[Fri, 14 Aug 2009 17:20:43 -0400] DEBUG: Loading plugin ruby
[Fri, 14 Aug 2009 17:20:43 -0400] DEBUG: Loading plugin languages
[Fri, 14 Aug 2009 17:20:43 -0400] DEBUG: Loading plugin kernel
[Fri, 14 Aug 2009 17:20:43 -0400] DEBUG: Plugin kernel threw exception #<NoMethodError: undefined method `fdiv' for 0:Fixnum>
[Fri, 14 Aug 2009 17:20:43 -0400] DEBUG: Loading plugin ohai_time
[Fri, 14 Aug 2009 17:20:43 -0400] DEBUG: Loading plugin keys
[Fri, 14 Aug 2009 17:20:43 -0400] DEBUG: Loading plugin hostname
[Fri, 14 Aug 2009 17:20:43 -0400] DEBUG: Loading plugin linux::hostname
[Fri, 14 Aug 2009 17:20:43 -0400] DEBUG: Plugin linux::hostname threw exception #<NoMethodError: undefined method `fdiv' for 0:Fixnum>
require 'rubygems'
require 'eventmachine'
require 'evma_httpserver'
require 'cgi'
class Room < EM::Channel
end
$room = Room.new
$welcome_html = DATA.read