Skip to content

Instantly share code, notes, and snippets.

View toddfreese's full-sized avatar

Todd Freese toddfreese

View GitHub Profile
I have this working CBL view that I need to reproduce as a CB view for a web client. We would like this over the public SG port
if possible.
CBLView *view = [self.document.database viewNamed: @"jobs/uniqueDayNumbersForJob"];
if (!view.mapBlock) {
NSString *const kSceneDocType = [Scene docType];
[view setMapBlock: MAPBLOCK({
if ([doc[@"type"] isEqualToString:kSceneDocType]) {
NSString *jobID = doc[@"job_id"];
NSString *sceneID = doc[@"_id"];
@toddfreese
toddfreese / gist:d8629a4ce6de7fe8e89b
Created September 5, 2014 16:12
CBL Logging for auth failure using CBLAuthenticator.
11:11:24.280| Logging mode 2 enabled in domains: {Sync, SyncVerbose}
11:11:24.282| ### Couchbase Lite 1.0 (unofficial) ###
11:11:24.311| Sync: CBLReplication[from http://approvalstest.filmworkers.com:4984/shotbotdb/]: offline, progress = 0 / 0, err: (null)
11:11:24.312‖ Sync: CBL_Puller[http://approvalstest.filmworkers.com:4984/shotbotdb/] STARTING ...
2014-09-05 11:11:24.311 ShotBOT[5419:90b] pull offline, Error=(null)
2014-09-05 11:11:24.312 ShotBOT[5419:90b] push stopped, Error=(null)
11:11:24.313| Sync: CBLReplication[to http://approvalstest.filmworkers.com:4984/shotbotdb/]: offline, progress = 0 / 0, err: (null)
2014-09-05 11:11:24.312 ShotBOT[5419:90b] pull offline, Error=(null)
2014-09-05 11:11:24.312 ShotBOT[5419:90b] push offline, Error=(null)
11:11:24.314‖ Sync: CBL_Puller[http://approvalstest.filmworkers.com:4984/shotbotdb/]: Reachability state = <approvalstest.filmworkers.com>:reachable (20002), suspended=0
@toddfreese
toddfreese / gist:04e3befb6b540423b1b2
Created August 29, 2014 22:06
CBL Logging for auth failure using NSURLCredential.
17:05:00.042| Logging mode 2 enabled in domains: {Sync, SyncVerbose}
17:05:00.043| ### Couchbase Lite 1.0 (unofficial) ###
17:05:00.065| Sync: CBLReplication[from http://approvalstest.filmworkers.com:4984/shotbotdb/]: offline, progress = 0 / 0, err: (null)
17:05:00.066‖ Sync: CBL_Puller[http://approvalstest.filmworkers.com:4984/shotbotdb/] STARTING ...
2014-08-29 17:05:00.065 ShotBOT[52013:90b] pull offline, Error=(null)
2014-08-29 17:05:00.066 ShotBOT[52013:90b] push stopped, Error=(null)
17:05:00.067| Sync: CBLReplication[to http://approvalstest.filmworkers.com:4984/shotbotdb/]: offline, progress = 0 / 0, err: (null)
17:05:00.067‖ SyncVerbose: CBL_Puller[http://approvalstest.filmworkers.com:4984/shotbotdb/]: Found credential, using CBLBasicAuthorizer[toddfreese/****]
2014-08-29 17:05:00.066 ShotBOT[52013:90b] pull offline, Error=(null)
2014-08-29 17:05:00.067 ShotBOT[52013:90b] push offline, Error=(null)
@toddfreese
toddfreese / gist:9677827
Created March 21, 2014 01:40
CBL Sync error
20:39:21.686| Logging mode 2 enabled in domains: {ChangeTracker, ChangeTrackerVerbose, Sync, SyncVerbose}
2014-03-20 20:39:26.719 ShotBOT[8851:70b] auto sync start.
20:39:26.722‖ Sync: CBL_Puller[http://approvalstest.filmworkers.com:4984/shotbotdb/] STARTING ...
20:39:26.727‖ Sync: CBL_Puller[http://approvalstest.filmworkers.com:4984/shotbotdb/]: Reachability state = <approvalstest.filmworkers.com>:unreachable (00), suspended=0
20:39:26.728‖ Sync: CBL_Pusher[http://approvalstest.filmworkers.com:4984/shotbotdb/] STARTING ...
20:39:26.729‖ Sync: CBL_Pusher[http://approvalstest.filmworkers.com:4984/shotbotdb/]: Reachability state = <approvalstest.filmworkers.com>:unreachable (00), suspended=0
20:39:26.808‖ Sync: CBL_Puller[http://approvalstest.filmworkers.com:4984/shotbotdb/]: Reachability state = <approvalstest.filmworkers.com>:reachable (02), suspended=0
20:39:26.808‖ Sync: CBL_Puller[http://approvalstest.filmworkers.com:4984/shotbotdb/]: Going online
20:39:26.809‖ Sync: CBL_Puller[http://approvalstest.filmwor
sh-3.2# /Volumes/Backup/sync_gateway -log=HTTP+,Changes,Cache /Users/admin/Desktop/couchbase-sync-gateway/bin/config.json
14:01:19.971450 Enabling logging: [HTTP+ Changes Cache]
14:01:19.971504 ==== Couchbase Sync Gateway/0.93 ====
14:01:19.971516 Configured Go to use all 8 CPUs; setenv GOMAXPROCS to override this
14:01:19.971522 Configured MaxFileDescriptors (RLIMIT_NOFILE) to 5000
14:01:19.971531 Opening db /shotbotdb as bucket "sync_gateway", pool "default", server <http://approvalstest.filmworkers.com:8091>
14:01:19.971560 Opening Couchbase database sync_gateway on <http://approvalstest.filmworkers.com:8091>
14:01:20.006506 Cache: Initialized changeCache with nextSequence=#110
14:01:20.008559 Reset guest user to config
14:01:20.008574 Starting admin server on 127.0.0.1:4985
@toddfreese
toddfreese / gist:9628160
Created March 18, 2014 19:57
New Logging data.
Log From Device A. Open app and start sync.
14:45:56.637| Logging mode 2 enabled in domains: {ChangeTracker, ChangeTrackerVerbose, Sync, SyncVerbose}
14:45:56.695‖ Sync: CBL_Puller[http://approvalstest.filmworkers.com:4984/shotbotdb/] STARTING ...
14:45:56.699‖ Sync: CBL_Puller[http://approvalstest.filmworkers.com:4984/shotbotdb/]: Reachability state = <approvalstest.filmworkers.com>:unreachable (00), suspended=0
2014-03-18 14:45:56.698 ShotBOT[13620:a0b] Application windows are expected to have a root view controller at the end of application launch
14:45:56.699‖ Sync: CBL_Pusher[http://approvalstest.filmworkers.com:4984/shotbotdb/] STARTING ...
14:45:56.700‖ Sync: CBL_Pusher[http://approvalstest.filmworkers.com:4984/shotbotdb/]: Reachability state = <approvalstest.filmworkers.com>:reachable (20002), suspended=0
14:45:56.700‖ Sync: CBL_Pusher[http://approvalstest.filmworkers.com:4984/shotbotdb/]: Going online
<IfModule mod_headers.c>
<filesMatch ".(gif|jpg|jpeg|png|pdf|psd|eps|tif|tiff|mov|mp4|aif|aiff|wav|wmv)$">
Header append Content-Disposition "attachment;"
</filesMatch>
Header add MS-Author-Via "DAV"
RequestHeader set X_FORWARDED_PROTO 'https' env=https
</IfModule>
- (void)downloadFileWithPath:(CPArray)fileURLs
{
// This method is called to start downloading a file.
// It gets called from the return responce of the getDownloadURL method.
//CPLog(@"downloadFileWithPath called with URL=%@", fileURL);
var x;
for(x=0; x<[fileURLs count]; x++) {
// Open off-screen window to start download. Window will automatically close and should be hidden all the time.
var chooseFile = [CPOpenPanel openPanel];
[chooseFile setCanChooseFiles:YES];
[chooseFile setCanChooseDirectories:NO];
[chooseFile setAllowsMultipleSelection:NO];
var result = [chooseFile runModal];
if (result == CPOKButton) {
CPLog(result);
}
uploadButton = [[CPButton alloc] initWithFrame:CGRectMake(490 + folderWidth, 13, 120, 24)];
[uploadButton setTitle:@"Asset Upload"];
[uploadButton setTarget:self];
[uploadButton setAction:@selector(upload:)];
var slices = [["Resources/button-bezel-disabled-left.png", 4.0, 24.0],
["Resources/button-bezel-disabled-center.png", 1.0, 24.0],
["Resources/button-bezel-disabled-right.png", 4.0, 24.0]];
[uploadButton setValue:CPColorWithImages(slices) forThemeAttribute:@"bezel-color" inState:CPThemeStateDisabled];