echo 'export NEWRELIC_DISPATCHER=pow' >> ~/.powconfig
echo 'export POW_WORKERS=1' >> ~/.powconfig
Explanation:
http://andre.arko.net/2011/11/12/use-newrelic-rpm-developer-mode-with-pow/
describe 'POST api/v1/sessions' do | |
def self.request(options) | |
let(:api_response) { | |
send( | |
options[:method].downcase, | |
options[:path], | |
options[:json], | |
) | |
last_response | |
} |
echo 'export NEWRELIC_DISPATCHER=pow' >> ~/.powconfig
echo 'export POW_WORKERS=1' >> ~/.powconfig
Explanation:
http://andre.arko.net/2011/11/12/use-newrelic-rpm-developer-mode-with-pow/
This may not be relevant to many, but it's a process that I just had to go through and it was a bit tricky to figure a smooth way to make it work.
The gist of it is that you must do the following:
pinger = Enumerator.new do |yielder| | |
loop | |
yielder << "PING" | |
end | |
end | |
pinger.each do |ping| | |
puts ping | |
puts "PONG" | |
end |
# Assuming all the methods called here also return true/false, | |
# use the logical composition operators to create a final result | |
# which can short-circuit if one of the methods fails: | |
def composed_method | |
frobulate_widgets and refrobulate_widgets and confribulate_frobulations | |
end |
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script> |
describe '#game_won?' do | |
winning = [ | |
<<-BOARD | |
.x... | |
ox... | |
oxo.. | |
oxo.. | |
BOARD | |
] | |
#!/usr/bin/env ruby | |
require 'benchmark' | |
REGEXPS = [ | |
/^no such file to load -- (.+)$/i, | |
/^Missing \w+ (?:file\s*)?([^\s]+.rb)$/i, | |
/^Missing API definition file in (.+)$/i, | |
/^cannot load such file -- (.+)$/i, | |
] |
require 'net/http' | |
require 'xmlsimple' | |
url = "http://www.user-agents.org/allagents.xml" | |
xml_data = Net::HTTP.get_response(URI.parse(url)).body | |
data = XmlSimple.xml_in(xml_data) | |
agents = data['user-agent'].select{|agent| type = agent["Type"].first; type.include?("R") || type.include?("S")} | |
agent_names = agents.collect {|agent| agent["String"].first} |
SELECT CASE WHEN total IS NULL THEN '' ELSE name END AS table, | |
index, | |
pg_size_pretty(size) AS size, | |
CASE WHEN total IS NULL THEN '' ELSE pg_size_pretty(total) END AS total | |
FROM | |
(SELECT name, | |
index, | |
size, | |
total | |
FROM |