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 'httparty' | |
require 'eventmachine' | |
class Request | |
include EM::Deferrable | |
@@requests = [] | |
attr_reader :method, :params |
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
10014: Jerrold Nadler => District 8, (202) 225-5635 | |
10014 is in NY | |
91108: David Dreier => District 26, (202) 225-2305 | |
91108: Adam B. Schiff => District 29, (202) 225-4176 | |
91108 is in CA | |
90210: Henry A. Waxman => District 30, (202) 225-3976 | |
90210: Howard L. Berman => District 28, (202) 225-4695 | |
90210 is in CA | |
10065: No Data Found | |
... |
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
$ time ruby request_serial.rb > serial | |
real 0m7.150s | |
user 0m0.423s | |
sys 0m0.146s | |
$ time ruby request.rb > parallel | |
real 0m2.274s | |
user 0m1.997s | |
sys 0m0.157s |
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 'redcarpet' # => 2.2.2 | |
require 'escape_utils' # => 0.3.2 | |
EscapeUtils.escape_html("test") | |
__END__ | |
ruby(11004,0x7fff75318960) malloc: *** error for object 0x106a20cd0: pointer being realloc'd was not allocated | |
*** set a breakpoint in malloc_error_break to debug | |
Abort trap: 6 |
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 'zendesk_api' | |
require 'oauth2' | |
client = OAuth2::Client.new('{my client unique identifier}', | |
'{my client secret}', | |
site: 'https://{subdomain}.zendesk.com', | |
token_url: "/oauth/tokens", | |
authorize_url: "/oauth/authorizations/new") | |
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/src/checks.c b/src/checks.c | |
index 0668a76..dba45f0 100644 | |
--- a/src/checks.c | |
+++ b/src/checks.c | |
@@ -1349,14 +1349,15 @@ static void event_srv_chk_r(struct connection *conn) | |
*check->bi->data = '\0'; | |
check->bi->i = 0; | |
- /* Close the connection... We absolutely want to perform a hard close | |
- * and reset the connection if some data are pending, otherwise we end |