Skip to content

Instantly share code, notes, and snippets.

View BigBlueHat's full-sized avatar
🎩
building Web things

BigBlueHat BigBlueHat

🎩
building Web things
View GitHub Profile
This local.ini, gets me the error below:
----------------------------------------
; CouchDB Configuration Settings
; Custom settings should be made in this file. They will override settings
; in default.ini, but unlike changes made to default.ini, this file won't be
; overwritten on server upgrade.
[couchdb]
;max_document_size = 4294967296 ; bytes
function beforeRender()
{
if ($this->params['url']['ext'] == 'html') {
$this->viewPath .= '/xml';
$this->layoutPath = 'xml';
}
$this->RequestHandler->respondAs($this->layoutPath);
}
PUT /testtest/html5 HTTP/1.0
Content-Type: application/json
{
"id": "5",
"category_id": "0",
"title": "A bunch of content",
"keywords": null,
"description": null,
"content": "<p>This is<\/p>\n<p>a content item<\/p>\n<p>with spaces<\/p>\n<p>and a<\/p>\n<p>whole<span class=\"pagebreak\"><\/span><\/p>\n<p>bunch<\/p>\n<p>of<\/p>\n<p>content<\/p>\n<p>at<\/p>\n<p>least<\/p>\n<p>vertically<\/p>\n<p>though<\/p>\n<p>not horizontally<\/p>\n<p>exactly...<\/p>\n<p>oh<\/p>\n<p>well<\/p>\n<p>really<\/p>",
{{badmatch,{error,eacces}},
[{couch_file,init,1},{gen_server,init_it,6},{proc_lib,init_p_do_apply,3}]}
@BigBlueHat
BigBlueHat / gist:604454
Created September 30, 2010 11:53
JSON Schema of an Event
{"description":"A representation of an event",
"type":"object",
"properties":{
"dtstart":{"format":"date-time","type":"string","description":"Event starting time","required":true},
"summary":{"type":"string","required":true},
# This is a bash script intended for use in a Mac OS X Automator Service script.
# Add the script below in a "Run Shell Script" action set to "/bin/bash" in Automator.
# Known issues (several...) are at the bottom.
# Edit this line to your CouchDB instance and a db you can write to.
couch="http://{replaceme}.couchone.com/{metoo}/"
for f in "$@"
do
filename=${f##*/}
@BigBlueHat
BigBlueHat / map.js
Created April 6, 2011 00:06
A test of complex keys for listing blog posts...keeping for reference
function(doc) {
// TODO: can we put this someplace "global"?
var max_posts = 10;
if (doc.type == 'page') {
var urlParts = doc.url.split('/');
for (var i in doc.page_items) {
for (var n in doc.page_items[i]) {
if (doc.page_items[i][n].posts != undefined) {
var post_count = 0;
for (var post in doc.page_items[i][n].posts) {
@BigBlueHat
BigBlueHat / tester.js
Created April 6, 2011 00:07
Simple _list tester for BlueInk page items
function(head, req) {
var row;
provides('html',
function() {
var page = {items:[],copyright:'BigBlueHat'};
var posts = [];
while(row = getRow()) {
log(row);
} // end while
log(page.items);
@BigBlueHat
BigBlueHat / jquery.combobox.js
Created April 19, 2011 20:05
improved version of Combobox code from jQuery UI docs
/**
Copyright 2011 Couchbase, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@BigBlueHat
BigBlueHat / dateToArray.js
Last active September 27, 2015 11:08
dateToArray - handy for emitting Cloudant & Apache CouchDB MapReduce keys based on dates
// MIT Licensed - http://choosealicense.com/licenses/mit/
function dateToArray(ts, length, utc) {
var length = length || 6,
d = (typeof ts === 'number' ? new Date(ts) : new Date()),
utc = Boolean(utc) || true;
if (utc) {
return [d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(),
d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(),
d.getUTCMilliseconds()]
.slice(0, length);