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
local count = 0 | |
core.register_service("auth", "http", function (applet) | |
count = count + 1 | |
-- Get X-Auth-Token -- | |
local token = applet.headers['x-auth-token'][0] | |
local cmd = 'curl -H "X-Auth-Token:'..token..'"' | |
cmd = cmd..' -sL -w "%{http_code}\\n"' | |
cmd = cmd..' "https://staging.identity-internal.api.rackspacecloud.com/v2.0/tokens/'..token..'"' | |
cmd = cmd..' -o /dev/null' |
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 'ruby-prof' | |
module M | |
def foo | |
puts "M#foo" | |
end | |
end | |
class C | |
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
% spec sp.rb ~ | |
...nil | |
{"Content-Type"=>"text/html"} | |
.Fnil | |
{"Content-Type"=>"text/html"} | |
Fnil | |
{"Content-Type"=>"text/html"} | |
. | |
1) |
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
it "returns 400 on POST if request is missing X-Package-Name header" do | |
post '/', "FOO", "Content-MD5" => "cccccccccccccccccccccccccccccccc" | |
last_response.status.should == 400 | |
last_response.body.should == "Missing parameter: package_name" | |
end | |
# % spec sp.rb ~ | |
# nil | |
# {"Content-Type"=>"text/html"} |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
int main(int argc, char **argv) { | |
char server[20] = "wwwsearch.bing.com"; | |
int result_count; | |
char query[20]; | |
char command[100]; | |
char buffer[10000]; |
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
md5 = Digest::MD5.new | |
md5 << File.read(filename) | |
puts [md5.hexdigest.scan(/../).pack("H2" * 16)].pack("m").chomp |
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 'sinatra' | |
class Blog < Sinatra::Default | |
get '/' do | |
.. | |
end | |
end | |
if __FILE__ == $0 | |
Blog.run! | |
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
require 'describe' | |
require 'fileutils' | |
require 'spec' | |
require 'sinatra/test' | |
require 'spec/interop/test' | |
set :environment, :test | |
describe 'Describe Service' do | |
include Sinatra::Test |
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
<?xml version="1.0" encoding="ISO-8859-1"?><METS:mets xmlns:METS="http://www.loc.gov/METS/" xmlns:daitss="http://www.fcla.edu/dls/md/daitss/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:mods="http://www.loc.gov/mods/v3" xmlns:palmm="http://www.fcla.edu/dls/md/palmm/" xmlns:rightsmd="http://www.fcla.edu/dls/md/rightsmd/" xmlns:techmd="http://www.fcla.edu/dls/md/techmd/" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" LABEL="May 2008 stats" OBJID="DT_DTL01_77643" TYPE="" xsi:schemaLocation="http://www.loc.gov/METS/ http://www.loc.gov/standards/mets/version17/mets.v1-7.xsd http://purl.org/dc/elements/1.1/ http://dublincore.org/schemas/xmls/simpledc20021212.xsd http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-0.xsd http://www.fcla.edu/dls/md/techmd/ http://www.fcla.edu/dls/md/techmd.xsd http://www.fcla.edu/dls/md/palmm/ http://www.fcla.edu/dls/md/palmm.xsd http://www.fcla.edu/dls/md/rightsmd/ htt |