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
def dispatch_action(klass, action, status = 200) | |
controller = klass.new(self, status) | |
- if Dispatcher.use_mutex then | |
+ if nil then | |
@@mutex.synchronize { controller._dispatch(action) } | |
else | |
controller._dispatch(action) | |
end | |
controller | |
end |
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
/usr/lib/ruby/1.8/timeout.rb:54:in `rbuf_fill': execution expired (Timeout::Error) | |
from /usr/lib/ruby/1.8/timeout.rb:56:in `timeout' | |
from /usr/lib/ruby/1.8/timeout.rb:76:in `timeout' | |
from /usr/lib/ruby/1.8/net/protocol.rb:132:in `rbuf_fill' | |
from /usr/lib/ruby/1.8/net/protocol.rb:116:in `readuntil' | |
from /usr/lib/ruby/1.8/net/protocol.rb:126:in `readline' | |
from /usr/lib/ruby/1.8/net/http.rb:2029:in `read_status_line' | |
from /usr/lib/ruby/1.8/net/http.rb:2018:in `read_new' | |
from /usr/lib/ruby/1.8/net/http.rb:1059:in `request' | |
... 24 levels... |
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
class QueueWorker < BackgrounDRb::MetaWorker | |
set_worker_name :queue_worker | |
QUEUE_WORKER_LIMIT = 2 | |
def create(args = nil) | |
start_correct_number_of_workers | |
end | |
def start_correct_number_of_workers | |
1.upto(QUEUE_WORKER_LIMIT) do |worker_key| |
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
c = (HttpConnection)Connector.open(url, Connector.READ_WRITE, false); | |
c.setRequestMethod(HttpConnection.POST); | |
c.setRequestProperty("Content-Language", "en-US"); | |
c.setRequestProperty( "User-Agent", "Mozilla/4.0"); | |
c.setRequestProperty( "Content-Type", "application/x-www-form-urlencoded"); | |
c.setRequestProperty( "Content-Length", encodedData.length() ); | |
os = c.openOutputStream(); | |
String rStr = this.req.toString(); | |
os.write(("mobile_request=" +rStr).getBytes()); |
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 'strscan' | |
# This is copied and slightly refactored from BareTest::TabularData | |
# | |
# Example | |
# LiteralParser.parse("nil") # => nil | |
# LiteralParser.parse(":foo") # => :foo | |
# LiteralParser.parse("123") # => 123 |
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
Add the following code block with the correct options to embed SupportBee in any website | |
<script src="http://sbassets.s3.amazonaws.com/widget/script.js" type="text/javascript"></script> | |
<script> | |
var sb_form = SupportBee.Form.initialize({ | |
company: 'techfolder', | |
height: '400px', | |
base_domain: 'supportbee.com', | |
position: 'bottom' | |
}); |
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
#!/bin/bash | |
# | |
# Copyright 2013 John Leach <[email protected]> | |
# | |
# Distributed under terms of the MIT license | |
# | |
# Takes a screeshot using scrot and uploads it via scp and sticks the | |
# url on the clipboard as quickly as possible. | |
# | |
# For speed, it cheats and puts the url on the clipboard *before* |
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
# Modify this file accordingly for your specific requirement. | |
# http://www.thegeekstuff.com | |
# 1. Delete all existing rules | |
iptables -F | |
# 2. Set default chain policies | |
iptables -P INPUT DROP | |
iptables -P FORWARD DROP | |
iptables -P OUTPUT DROP |