This file contains hidden or 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
# Rack Nested Params Parser Spec | |
Rack::Utils.parse_query("x[y][z]=10"). | |
should.equal "x" => {"y" => {"z" => "10"}} | |
Rack::Utils.parse_query("x[y][z][]=10"). | |
should.equal "x" => {"y" => {"z" => ["10"]}} | |
Rack::Utils.parse_query("x[y][z][]=10&x[y][z][]=5"). | |
should.equal "x" => {"y" => {"z" => ["10", "5"]}} | |
Rack::Utils.parse_query("x[y][][z]=10"). | |
should.equal "x" => {"y" => [{"z" => "10"}]} | |
Rack::Utils.parse_query("x[y][][z]=10&x[y][][w]=10"). |
This file contains hidden or 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
#don't use sinatra/main. we don't want the kitchen sink, just pretty rack apps | |
require 'sinatra/base' | |
class SinatraRailsPlugin < Sinatra::Base | |
get '/foo' do | |
'bar' | |
end | |
#this hackeration is required for sinatra to be a nice rack citizen |
This file contains hidden or 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 Rack::Logger | |
def initialize(app, logger) | |
@app = app | |
@logger = logger | |
end | |
def call(env) | |
env["rack.logger"] = @logger | |
result = @app.call(env) | |
@logger.flush if @logger.respond_to?(:flush) |
This file contains hidden or 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
import java.util.HashMap; | |
public class App { | |
private static int installWindowWidth = 500, installWindowHeight = 350; | |
private static int adminWindowWidth = 400, adminWindowHeight = 275; | |
private static String server = "168.28.247.195", port = "3306", database = "software"; | |
private static String user = "root", password = ""; | |
private static String axeServer = "https://168.28.245.221:6467"; | |
private static String webServer = "http://168.28.247.195:3000"; |
NewerOlder