View gist:6b2aaab50cac65a886b529a470cdb3f5
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
### Keybase proof | |
I hereby claim: | |
* I am ender672 on github. | |
* I am timothy_elliott (https://keybase.io/timothy_elliott) on keybase. | |
* I have a public key ASBqzzBkXMw06Qfxt3mwY9GU4kiLzvhHUsfb0CwX37ukQgo | |
To claim this, I am signing this object: |
View gist:2638291
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
# Puma hangs when it receives a SIGTERM in Linux x86_64. Reproduce as follows: | |
# | |
# Start Puma | |
# $ puma | |
# | |
# Get the PID for Puma | |
# $ ps u | |
# | |
# Send SIGTERM | |
# $ kill 4321 |
View gist:2582334
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 'socket' | |
require 'uri' | |
require 'rack/handler' # gem install rack | |
require 'rack/rewindable_input' | |
require 'http/parser' # gem install http_parser.rb | |
require 'stringio' | |
module Rack::Handler | |
module Qute | |
def self.run(app, options={}) |
View gist:2378417
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 'rack/handler' | |
require 'socket' | |
require 'puma/puma_http11' | |
module Rack::Handler | |
module Qute | |
READ_SIZE = 500000 | |
module NullIO | |
def self.gets; end |
View gist:2175941
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 'rack' | |
require 'oil' | |
app = lambda do |env| | |
r = Rack::Request.new(env) | |
io = File.new(File.join('images', File.basename(r.path)), 'rb') | |
body = Oil::JPEG.new(io, r[:w].to_i, r[:h].to_i) | |
[200, { 'Content-Type' => 'image/jpeg' }, body] | |
end |
View gist:1872559
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
#include <string.h> | |
#include <libxml/tree.h> | |
#include <libxml/xpath.h> | |
void | |
main() | |
{ | |
xmlDocPtr doc; | |
xmlNodePtr cur; | |
xmlXPathContextPtr ctx; |
View gist:1870254
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
diff --git a/ext/nokogiri/xml_document.c b/ext/nokogiri/xml_document.c | |
index 348344c..9f035ad 100644 | |
--- a/ext/nokogiri/xml_document.c | |
+++ b/ext/nokogiri/xml_document.c | |
@@ -38,6 +38,13 @@ static void dealloc(xmlDocPtr doc) | |
NOKOGIRI_DEBUG_END(doc); | |
} | |
+static void | |
+mark(xmlDocPtr doc) |
View gist:1864519
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
diff --git a/lib/nokogiri/xml/node_set.rb b/lib/nokogiri/xml/node_set.rb | |
index 37b3848..149e90e 100644 | |
--- a/lib/nokogiri/xml/node_set.rb | |
+++ b/lib/nokogiri/xml/node_set.rb | |
@@ -240,6 +240,14 @@ module Nokogiri | |
end | |
end | |
+ def map | |
+ a = [] |
View gist:1831918
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
diff --git a/lib/nokogiri/xml/node_set.rb b/lib/nokogiri/xml/node_set.rb | |
index 37b3848..cb99cdd 100644 | |
--- a/lib/nokogiri/xml/node_set.rb | |
+++ b/lib/nokogiri/xml/node_set.rb | |
@@ -234,8 +234,8 @@ module Nokogiri | |
### | |
# Iterate over each node, yielding to +block+ | |
- def each(&block) | |
- 0.upto(length - 1) do |x| |
View config.ru
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 './signed_request_uri' | |
require 'rack/file' | |
use Rack::SignedRequestUri, 'top secret' | |
run Rack::File.new('images') |
NewerOlder