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
| %h1 A Doc from CouchDB! | |
| - @result.each do |k,v| | |
| %b=k | |
| %em=v | |
| %br |
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
| DB = "#{ENV['CLOUDANT_URL']}/music" | |
| get "/doc/:doc" do | |
| doc = RestClient.get("#{DB}/#{params[:doc]}") | |
| @result = JSON.parse(doc) | |
| haml :doc_id | |
| end |
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
| begin | |
| RestClient.put("#{ENV['CLOUDANT_URL']}/SOMEDATABASE", "") | |
| rescue | |
| puts "database already created" | |
| end |
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 couchdbkit, boto |
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
| server = Server('http://user:[email protected]) | |
| db = server.get_or_create(dbname) | |
| doc = db[docid] | |
| db.put_attachment(doc, file(filename)) |
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
| conn = S3Connection(amazon_ID, amazon_KEY) | |
| bucket = conn.get_bucket(bucketname) | |
| k = Key(Bucket) | |
| k.set_contents_from_filename(filename) |
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
| git clone git://github.com/cloudant/opencore.git |
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
| 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 |
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
| ;;; 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: |
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
| #!/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) -> |