Skip to content

Instantly share code, notes, and snippets.

%h1 A Doc from CouchDB!
- @result.each do |k,v|
%b=k
%em=v
%br
DB = "#{ENV['CLOUDANT_URL']}/music"
get "/doc/:doc" do
doc = RestClient.get("#{DB}/#{params[:doc]}")
@result = JSON.parse(doc)
haml :doc_id
end
begin
RestClient.put("#{ENV['CLOUDANT_URL']}/SOMEDATABASE", "")
rescue
puts "database already created"
end
import couchdbkit, boto
server = Server('http://user:[email protected])
db = server.get_or_create(dbname)
doc = db[docid]
db.put_attachment(doc, file(filename))
conn = S3Connection(amazon_ID, amazon_KEY)
bucket = conn.get_bucket(bucketname)
k = Key(Bucket)
k.set_contents_from_filename(filename)
git clone git://github.com/cloudant/opencore.git
jQuery.ajax({
type: "PUT",
url: "http://key:[email protected]:5984/staging/doc1",
data: '{}',
contentType: "application/json",
success: function (data, textStatus, XMLHttpRequest) {
alert("ok " + data);
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert("ko"); // {}, "error", undefined
;;; haml-mode.el --- Major mode for editing Haml files
;; Copyright (c) 2007, 2008 Nathan Weizenbaum
;; Author: Nathan Weizenbaum
;; URL: http://github.com/nex3/haml/tree/master
;; Version: 1.0
;; Keywords: markup, language
;;; Commentary:
#!/usr/bin/env coffee
# The URL of the web site to make crawlable
URL: 'http://localhost'
# Time to wait for all the scripts to run, in ms
DELAY: 3000
# Script to run to clean up the markup before serializing
CLEANUP: (window) ->