Skip to content

Instantly share code, notes, and snippets.

@espy
espy / gist:3098188
Created July 12, 2012 13:43
I have a Dreamcode
// Making individual Attributes in a document public
// Problem: direct couch access
{
"_id":"couch/ag0qdhr",
"_rev":"8-b109320befe2c1db1e9c770911a3cd7c",
"$public": ["email", "color"],
"type":"couch"
"color":"purple",
"email": "terriblyimportant@posh.com",
@espy
espy / qtranslate_javacript.php
Created October 17, 2012 10:26
Extend qTranslate for WordPress to automatically generate slugs for qTranslate Slug
# add this function to the end of qtrans_initJS() in qtranslate_javacript.php
$q_config['js']['qtrans_autogenerate_slug'] = "
function string_to_slug(str) {
str = str.replace(/^\s+|\s+$/g, ''); // trim
str = str.toLowerCase();
// remove accents, swap ñ for n, etc
var from = 'àáäâèéëêìíïîòóöôùúüûñç·/_,:;';
var to = 'aaaaeeeeiiiioooouuuunc------';
{"docs":[{"_rev":"5-yql4g4xsv","text":"Woop","point":"q2yn3j6","createdBy":"wkcnhzj","updatedAt":"2013-07-04T12:39:38.575Z","createdAt":"2013-07-04T12:39:38.575Z","_revisions":{"start":5,"ids":["yql4g4xsv","kz4d10zis"]},"_deleted":true,"type":"message","_id":"message/jxr55qw"},{"_rev":"5-j2dkaxivl","text":"Aha","point":"q2yn3j6","createdBy":"wkcnhzj","updatedAt":"2013-07-04T12:39:40.894Z","createdAt":"2013-07-04T12:39:40.894Z","_revisions":{"start":5,"ids":["j2dkaxivl","o1wiegtiu"]},"_deleted":true,"type":"message","_id":"message/2s1xfxu"},{"_rev":"5-v3g3dnf74","text":"Yay!","point":"zp08o8b","createdBy":"wkcnhzj","updatedAt":"2013-07-04T12:39:44.736Z","createdAt":"2013-07-04T12:39:44.736Z","_revisions":{"start":5,"ids":["v3g3dnf74","5o8inyy65"]},"_deleted":true,"type":"message","_id":"message/dt0czqc"},{"_rev":"5-98ysmy8zu","x":346,"y":589,"image":"sh9lz6q","createdBy":"wkcnhzj","updatedAt":"2013-07-04T12:39:35.217Z","createdAt":"2013-07-04T12:39:35.217Z","_revisions":{"start":5,"ids":["98ysmy8zu","cxqzbxe4g
[www] OPTIONS /_api/_users/org.couchdb.user%3Auser_anonymous%2F1232131 200 0ms
[www] PUT /_api/_users/org.couchdb.user%3Auser_anonymous%2F1232131 201 11ms - 102b
[email-out] binding to db: "1232131"
this.config
{ server: 'http://127.0.0.1:6018',
persistent_since_storage: false,
admin: { user: 'admin', pass: 'admin' },
app: { email: { transport: [Object] } },
user: {} }
[email-out] Starting EmailOut Worker for user/1232131
[Fri, 12 Jul 2013 15:42:43 GMT] [error] [<0.129.0>] {error_report,<0.30.0>,
{<0.129.0>,crash_report,
[[{initial_call,
{mochiweb_socket_server,init,['Argument__1']}},
{pid,<0.129.0>},
{registered_name,[]},
{error_info,
{exit,eaddrinuse,
[{gen_server,init_it,6,
[{file,"gen_server.erl"},{line,320}]},
/Library/Caches/Homebrew/Formula/couchdb.brewing
/Library/Caches/Homebrew/couchdb-1.2.1.tar.gz
/Users/espy/Documents/Projects/Couchdb Aufkleber/couchdb_79x70.ai
/Users/espy/Documents/Projects/Couchdb Aufkleber/couchdb_81x70.ai
/Users/espy/Documents/Projects/Couchdb Aufkleber/couchdb_with_bleed.ai
/Users/espy/Documents/Projects/hoodie/couchdb-plugins-demo.mov
/Users/espy/Sites/Libraries/yeomanPHP/yeoman/cli/node_modules/prompt/node_modules/winston/docs/winston/transports/couchdb.html
/Users/espy/Sites/Libraries/yeomanPHP/yeoman/cli/node_modules/prompt/node_modules/winston/examples/couchdb.js
/Users/espy/Sites/Libraries/yeomanPHP/yeoman/cli/node_modules/prompt/node_modules/winston/lib/winston/transports/couchdb.js
/Users/espy/Sites/Libraries/yeomanPHP/yeoman/cli/node_modules/prompt/node_modules/winston/test/transports/couchdb-test.js
>npm install -g hoodie-cli —verbose
npm info it worked if it ends with ok
npm info using npm@0.3.18
npm info using node@v0.4.7
npm ERR! Error: 404 Not Found: %E2%80%94verbose
npm ERR! at IncomingMessage.<anonymous> (/usr/lib/node/.npm/npm/0.3.18/package/lib/utils/registry/request.js:169:16)
npm ERR! at IncomingMessage.emit (events.js:81:20)
npm ERR! at HTTPParser.onMessageComplete (http.js:133:23)
npm ERR! at Socket.ondata (http.js:1213:22)
npm ERR! at Socket._onReadable (net.js:681:27)
>npm install -g -v hoodie-cli
npm info it worked if it ends with ok
npm info using npm@0.3.18
npm info using node@v0.4.7
npm info fetch http://registry.npmjs.org/hoodie-cli/-/hoodie-cli-0.4.7.tgz
npm info calculating sha1 /var/folders/df/d4gk92hs7ts317rs0wgrntdc0000gn/T/npm-1392625992849/1392625992849-0.06830340344458818/tmp.tgz
npm info shasum 39aea6954221f4d2a3199c3bfcbead7ae50f673f
npm info calculating sha1 /usr/lib/node/.npm/.cache/hoodie-cli/0.4.7/package.tgz
npm info shasum 2c607befbd6c0924808ddc1d8d7db41534be8144
npm info range colors@0.6.x
>npm install -g -v hoodie-cli
npm info it worked if it ends with ok
npm info using npm@0.3.18
npm info using node@v0.4.7
npm info fetch http://registry.npmjs.org/hoodie-cli/-/hoodie-cli-0.4.8.tgz
npm info calculating sha1 /var/folders/df/d4gk92hs7ts317rs0wgrntdc0000gn/T/npm-1392626471348/1392626471348-0.2605098073836416/tmp.tgz
npm info shasum 2674e7093d507466499d28a458a019dd4ed04bf1
npm info calculating sha1 /usr/lib/node/.npm/.cache/hoodie-cli/0.4.8/package.tgz
npm info shasum 377fc8171c08ccba9e9f9880057cbbdaff51db42
npm info fetch http://registry.npmjs.org/prompt/-/prompt-0.2.12.tgz
Object
info:Object
authentication_db:"_users"
authentication_handlers:Array[3]
0:"oauth"
1:"cookie"
2:"default"
ok:true
userCtx:Object
name:null