Skip to content

Instantly share code, notes, and snippets.

@flazz
Created October 28, 2009 01:41
Show Gist options
  • Save flazz/220157 to your computer and use it in GitHub Desktop.
Save flazz/220157 to your computer and use it in GitHub Desktop.
require "sinatra"
require "json"
# this should integrate to a real Q
DATA = %w(foo bar baz eta beta alfa romeo)
get "/q" do
JSON.generate(DATA).to_s
end
get "/move" do
subject = DATA.delete_at params[:index].to_i
DATA.insert params[:newindex].to_i subject
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment