This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'nokogiri' | |
doc = Nokogiri.HTML DATA | |
doc.xpath('//div//text()').map { |x| x.content = x.to_s } | |
p doc.serialize(:save_with => Nokogiri::XML::Node::SaveOptions::NO_DECLARATION) | |
__END__ | |
<div> <span>x</span></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'bert' | |
require 'json' | |
require 'yajl' | |
require 'benchmark' | |
ITER = 1_000 | |
tiny = t[:ok, :awesome] | |
small = t[:ok, :answers, [42] * 42] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Used to graph results from autobench | |
# | |
# Usage: ruby autobench_grapher.rb result_from_autobench.tsv | |
# | |
# This will generate three svg & png graphs | |
require "rubygems" | |
require "scruffy" | |
require 'csv' | |
require 'yaml' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
== Signal handling | |
In general, signals need only be sent to the master process. However, | |
the signals Unicorn uses internally to communicate with the worker | |
processes are documented here as well. | |
=== Master Process | |
* HUP - reload config file, app, and gracefully restart all workers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
asdasdas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
asfsgasgsgasg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
MyUpdater = { | |
since:'<%= @since.to_f %>', | |
u: function() { | |
new Ajax.PeriodicalUpdater('notes','/poller', { | |
asynchronous:false, | |
frequency:'4', | |
method:'get', | |
parameters:"since="+MyUpdater.since, | |
insertion:'top', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The FUGPL License | |
=================== | |
Free software should be truly free. The GPL and its derivatives infringe | |
upon the freedoms of the licensee by forcing distribution of code with | |
distribution of software. This license is a protest against anti-business, | |
anti-freedom licenses such as the GPL. | |
Permission is hereby granted, free of charge, to any person obtaining | |
a copy of this software and associated documentation files (the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Jabber | |
def self.read | |
size = $stdin.read(2).unpack("n").first | |
$stdin.read(size).split(':') | |
end | |
def self.write(success) | |
answer = success ? 1 : 0 | |
token = [2, answer].pack("nn") | |
$stdout.write(token) |