# This example does an AJAX lookup and is in CoffeeScript
$('.typeahead').typeahead(
# source can be a function
source: (typeahead, query) ->
# this function receives the typeahead object and the query string
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
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
$.couch.urlPrefix = "https://username:[email protected]"; | |
var db = $.couch.db('crud'); | |
var doc = {"_id":"foo", "name": "bar"}; | |
db.saveDoc(doc, { | |
success: function(response, textStatus, jqXHR){ | |
console.log(response); | |
}, |
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
<html> | |
<head> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(function() { | |
$.when( | |
$.ajax("/_session"), | |
$.ajax("/test_couchapp2"), | |
$.ajax("/_all_dbs"), | |
$.ajax("/_session") |
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
var app = { | |
renderView: function(baseView, selector, view, options, callback) { | |
baseView.setView(selector, new view(options)).render().then(callback); | |
} | |
}; | |
app.renderView(this, "FAKEITEM", Views.Popover, {model:view.model}, function(popoverEle) { | |
$(el).find("i.database-info").popover({ | |
title: "displaying info", | |
content: popoverEle.innerHTML |
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
1 compiler notes: | |
Unknown location: | |
error: clojure.lang.ArityException: Wrong number of args (3) passed to: cache$lru-cache-factory | |
core.clj:4:1: | |
error: clojure.lang.ArityException: Wrong number of args (3) passed to: cache$lru-cache-factory, compiling:(core.clj:4) | |
Compilation failed. |
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
str = '<?xml version="1.0"?><feed xmlns:media="http://search.yahoo.com/mrss/" xmlns:gr="http://www.google.com/schemas/reader/atom/" xmlns:idx="urn:atom-extension:indexing" xmlns="http://www.w3.org/2005/Atom" idx:index="no" gr:dir="ltr"><gr:continuation>CMKC26-OorAC</gr:continuation></feed>' | |
str = '<?xml version="1.0"?><feed xmlns:media="http://search.yahoo.com/mrss/" xmlns:gr="http://www.google.com/schemas/reader/atom/" xmlns:idx="urn:atom-extension:indexing" xmlns="http://www.w3.org/2005/Atom" idx:index="no" gr:dir="ltr"><gr:continuation>CMKC26-OorAC</gr:continuation></feed>' | |
>>> x = BeautifulSoup(str, 'xml') | |
x = BeautifulSoup(str, 'xml') | |
>>> x | |
x | |
<?xml version="1.0" encoding="utf-8"?> | |
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:gr="http://www.google.com/schemas/reader/atom/" xmlns:idx="urn:atom-extension:indexing" xmlns:media="http://search.yahoo.com/mrss/" {http://www.google.com/schemas/reader/atom/}dir="ltr" {urn:atom-extension:indexing}index="no"><gr:continuation>CMKC26-OorAC</continuation></feed> | |
>>> |
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
#!/bin/sh | |
url="$(echo -n $1 | perl -p -e 's/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg')" | |
host="http://databook.chewbranca.com" | |
request="/api/v1/quick_post" | |
api_key="API_KEY" | |
CURL=`which curl` | |
$CURL -X GET "${host}$request?a=$api_key&u=$url" |
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
curl -X PUT http://localhost:5984/test | |
erica create-app app-id=test | |
cd test | |
erica push http://localhost:5984/test | |
cd /tmp | |
couchapp clone http://localhost:5984/test/_design/test | |
errors out with: |
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
$ make | |
==> erica (get-deps) | |
Pulling couchbeam from {git,"http://github.com/benoitc/couchbeam.git", | |
"master"} | |
Initialized empty Git repository in /tmp/erica/deps/couchbeam/.git/ | |
==> couchbeam (get-deps) | |
Pulling mochiweb from {git,"http://github.com/mochi/mochiweb.git", | |
{tag,"1.5.2"}} | |
Initialized empty Git repository in /tmp/erica/deps/mochiweb/.git/ | |
Pulling ejson from {git,"http://github.com/benoitc/ejson.git","master"} |