Skip to content

Instantly share code, notes, and snippets.

View topfunky's full-sized avatar
🛠️

Geoffrey Grosenbach topfunky

🛠️
View GitHub Profile
#!/usr/bin/env ruby
# Use as TextMate command to convert
require 'iconv'
puts Iconv.iconv('utf-8', 'utf-16le', File.read(ENV['TM_FILEPATH'])).first
g = Gruff::Line.new(400)
g.title = "Transparent Background"
g.theme = {
:colors => ['black', 'grey', 'red', '#ff43a7'],
:marker_color => 'grey',
:font_color => 'black',
:background_colors => 'transparent'
}
##
# AUTHORS: Geoffrey Grosenbach http://nubyonrails.com
# Also http://p.ramaze.net/1887
#
# INSTALLATION:
# Copy to spec/lib/rexml_spec.rb, or any subdirectory of "spec"
#
# RUN:
# spec spec/lib/rexml_spec.rb
#
@topfunky
topfunky / gist:7224
Created August 26, 2008 06:23 — forked from lachie/gist:7221
/´¯/)
/´¯/) ,/¯ /
,/¯ / / /
/ /´¯/'¯¯'/´¯¯¯`·¸
/ / / / /¨¯\
('( ´ ´ ¯~/' ')
\ ' /
'' \ _ ·´
\ (
\ \
(function(i) {u = navigator.userAgent; e = /*@cc_on!@*/false; st = setTimeout;
if(/webkit/i.test(u)){st(function(){dr = document.readyState;if(dr=="loaded"||
dr=="complete"){i();}else{st(arguments.callee,10);}},10);}else if((/mozilla/i.
test(u)&&!/(compati)/.test(u))||(/opera/i.test(u))){document.addEventListener(
"DOMContentLoaded",i,false);} else if(e){(function(){t=document.createElement(
'doc:ready');try{t.doScroll('left');i();t= null;}catch(e){st(arguments.callee,
0);}})();}else{window.onload = i;}})(function() {
// Stylesheet loaded into HEAD tag directly, but in-line it to avoid
// making another HTTP request.
#!/bin/env ruby -w
require 'optparse'
require File.dirname(__FILE__) + "/../lib/couchrest"
# Set defaults
options = {
:verbose => false,
:design_name => "_design",
}
# NOTE: See further development and a gem at http://github.com/topfunky/basic_model
require 'couchrest'
##
# A minimal class to help use CouchDB and CouchRest with Rails.
#
# Provides dot notation access for all attributes, one level deep.
#
# note.title
# Updated for current plugin
def log_to_exceptional(exception)
logger.info "Exception #{exception.inspect}"
Exceptional.handle(exception, self, request, params)
rescue NoMethodError
logger.info "Couldn't log to Exceptional"
end
desc "Install merb from the repository"
task :default do
system "sudo gem install wycats-thor -s http://gems.github.com"
system "curl -L http://merbivore.com/merb.thor > merb.thor"
system "sudo thor merb:edge --install"
system "sudo thor merb:edge:plugins ---install"
system "sudo thor merb:edge:do mysql --install"
system "sudo thor merb:edge:dm_core --install"
system "sudo thor merb:edge:dm_more --install"
irb> require 'rubygems'; require 'beanstalk-client';
irb> p = Beanstalk::Pool.new(['localhost:11300'])
EOFError: EOFError
irb> p.put "hello"
EOFError: EOFError
EOFError: EOFError
SocketError: getaddrinfo: Name or service not known
Beanstalk::NotConnected: Beanstalk::NotConnected