Skip to content

Instantly share code, notes, and snippets.

View tenderlove's full-sized avatar
©️
 ​[object Object] :trollface:

Aaron Patterson tenderlove

©️
 ​[object Object] :trollface:
View GitHub Profile
require "set"
module RakeTask
CALLED = Set.new
NAMESPACES = []
TASKS = Hash.new { |h, k| h[k] = Struct.new(:blocks, :deps).new([], []) }
class << self
def call(name)
return if CALLED.include?(name)
@tenderlove
tenderlove / meta.rb
Created September 26, 2008 18:32 — forked from jbarnette/meta.rb
require "rubygems"
require "johnson"
require "./visitor.rb"
js =<<-END
function top() {
"top docstring", { command: true }
doSomething();
};
=begin
Pivotal Tracker API client (note: super-not-ready)
USAGE
Finding a project:
project = PivotalTracker::Projet.find(1)
We couldn’t find that file to show.
We couldn’t find that file to show.
require 'rubygems'
require 'nokogiri'
class Nokogiri::XML::Node
def method_missing name, *args, &block
if args.empty?
list = xpath("./#{name}")
elsif args.first.is_a? Hash
hash = args.first
if hash[:css]
module Nokogiri
module XML
class Builder
def insert_html(html)
Nokogiri::HTML.fragment(html).each do |child|
insert child
end
end
require "rubygems"
require "nokogiri"
require "eventmachine"
##
# This is the XML SAX Parser that accepts "pushed" content used by Babylon Gem.
class XmppParser < Nokogiri::XML::SAX::Document
##
# Initialize the parser and adds the callback that will be called upen stanza completion
require "rubygems"
require "nokogiri"
require 'dike'
Dike.logfactory '/tmp/dikelogfactory/'
class ZipZap
attr_reader :zip, :zap
def initialize
@zip = "zip"
@zap = "zap"
# Require slash
# by Aaron Patterson
# inspired by Josh Susser
# use to require files relative to the current file:
#
# require __FILE__/"lib"/"foo"
# require __FILE__/%{lib foo}
class String