Skip to content

Instantly share code, notes, and snippets.

Avatar
🛋️

Dave Cottlehuber dch

🛋️
View GitHub Profile
View setup.py
# fix for http://github.com/couchapp/couchapp/issues/#issue/55
options = dict(py2exe={ 'dll_excludes': [ "kernelbase.dll", "powrprof.dll" ] },
@dch
dch / getting_the_bits_for_building_erlang_and_couchdb
Created Aug 16, 2010
Getting the bits for building erlang and CouchDB on Windows
View getting_the_bits_for_building_erlang_and_couchdb
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\couchdb>d:
D:\>dir
Volume in drive D is Relax_with_CouchDB
Volume Serial Number is 92D6-4E48
Directory of D:\
@dch
dch / build_mozilla-javascript-HEAD_from_source_on_windows
Created Aug 16, 2010
build mozilla javascript - HEAD from source on windows
View build_mozilla-javascript-HEAD_from_source_on_windows
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\couchdb>pushd \mozilla-build
D:\mozilla-build>dir
Volume in drive D is Relax_with_CouchDB
Volume Serial Number is 92D6-4E48
Directory of D:\mozilla-build
@dch
dch / building_seamonkey_2.0.6_for_javascript_engine.cmd
Created Aug 16, 2010
build mozilla javascript for windows using seamonkey 2.0.6 release
View building_seamonkey_2.0.6_for_javascript_engine.cmd
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\couchdb>pushd mozilla-build
D:\mozilla-build>start-msvc9.bat
"Mozilla tools directory: D:\mozilla-build\"
Windows SDK directory: C:\Program Files\Microsoft SDKs\Windows\v7.0\
Windows SDK version: 7.0
Setting environment for using Microsoft Visual Studio 2008 x86 tools.
@dch
dch / couchdb_with_erlang_R13B04_build_on_windows
Created Aug 17, 2010
building couchdb with erlang R13B04 on windows
View couchdb_with_erlang_R13B04_build_on_windows
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\couchdb>d:\install\bin\relax_13B04.cmd
Setting environment for using Microsoft Visual Studio 2008 x86 tools.
current path:
/src/otp_src_R13B04/release/win32/erts-5.7.5/bin
/src/otp_src_R13B04/erts/etc/win32/cygwin_tools/vc
/src/otp_src_R13B04/erts/etc/win32/cygwin_tools
/cygdrive/c/PROGRA~2/MICROS~1.0/Common7/IDE
/cygdrive/c/PROGRA~2/MICROS~1.0/VC/BIN
@dch
dch / couchdb_view_attachment_names
Created Jan 30, 2011
CouchDB map that provides doc id and attachment names for easy URL conversion
View couchdb_view_attachment_names
// view map for generating URLs to stubbed attachments
function(doc) {
if (doc._attachments) {
for (var i in doc._attachments) {
emit(doc._id, doc._id + "/" + i);
}
}
}
// example document
@dch
dch / CouchDB::Client
Created Feb 7, 2011
read, push, pull via CouchDB::Client
View CouchDB::Client
#!/usr/local/bin/perl
$|=1;
use CouchDB::Client;
#only do this if you need admin logon
#my $c = CouchDB::Client->new(uri => 'http://admin:password@muse.couchone.com:5984/');
my $c = CouchDB::Client->new(uri => 'http://muse.couchone.com:5984/');
$c->testConnection or die "The server cannot be reached";
View brew_install_icu4c.txt
dave@akai:~ $ brew uninstall icu4c
Uninstalling /usr/local/Cellar/icu4c/4.4.1...
dave@akai:~ $ brew install -vd icu4c
Warning: Xcode is not installed! Builds may fail!
==> Downloading http://download.icu-project.org/files/icu4c/4.4.1/icu4c-4_4_1-src.tgz
File already downloaded and cached to /Users/dave/Library/Caches/Homebrew
/usr/bin/tar xf /Users/dave/Library/Caches/Homebrew/icu4c-4.4.1.tgz
==> Downloading patches
==> Patching
/usr/bin/patch -f -p1 -i 001-homebrew.diff
View gist:924372
dave@continuity:/Users/dave $ stop_couch
dave@continuity:/Users/dave $ cd /
dave@continuity:/Users/dave $ sudo -u couchdb -s
continuity% cd /usr/local/bin
continuity% couchdb -i
Erlang R14B01 (erts-5.8.2) [source] [64-bit] [smp:2:2] [rq:2] [async-threads:4] [hipe] [kernel-poll:true]
Eshell V5.8.2 (abort with ^G)
1> Apache CouchDB 1.0.2 (LogLevel=debug) is starting.
Configuration Settings ["/usr/local/etc/couchdb/default.ini",
View USAGE.md

CRUD requires jquery.deepjson.js to work so it should be included

<script type="text/javascript" src="js/jquery.deepjson.js"></script>

Then you can assign whatever's in crud.json to a variable or you can put crud.json into your evently directory and let couchapp push it to your application.

Simplest way to use it is