Skip to content

Instantly share code, notes, and snippets.

@borrrden
borrrden / gist:3810236
Created October 1, 2012 08:08
example of auto rotate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.viewController = [[SO2ViewController alloc] initWithNibName:@"SO2ViewController" bundle:nil];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}
@borrrden
borrrden / Event Rules
Created October 2, 2012 08:27 — forked from pratikshabhisikar/Event Rules
NSChat room event rules
1. Please refrain from chat conversations while a speaker is presenting. It distracts from the purpose of the event, and makes the speaker's text more difficult to read. Any user who engages in this behavior will be warned by a room owner for their first offense. After the second offense, the user in question will lose his/her write access for the duration of the event.
2. Please refrain from asking questions that are not related to the current topic. Time is limited and to ensure the best experience for all, we would only like to address questions that are directly related to what the speaker has presented. Unrelated questions will not be addressed, and will be dealt with in the same manner as unrelated conversation (see rule 1). #NOTE: For this, we gotta somehow display the room isn't accepting any questions that time. (Maybe by changing the room status ??)
3. Valid questions may only be asked after the speaker has finished speaking. We seek to minimize interruptions to the speaker's presentation.
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildCommunityTasksPath Condition=" '$(MSBuildCommunityTasksPath)' == '' ">$(SolutionDir)\packages\MSBuildTasks.1.4.0.88\tools</MSBuildCommunityTasksPath>
<SetAssemblyVersionEnabled Condition=" Exists('$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.targets') ">true</SetAssemblyVersionEnabled>
<SetAssemblyVersionEnabled Condition=" '$(SetAssemblyVersionEnabled)' == '' ">false</SetAssemblyVersionEnabled>
<SetAssemblyVersionEnabled Condition=" $(DefineConstants.Contains('OFFICIAL'))">false</SetAssemblyVersionEnabled>
<UseMSBuildEngine>False</UseMSBuildEngine>
</PropertyGroup>
<Choose>
Building: Couchbase.Lite.Net35 (Release)
Performing main compilation...
/Library/Frameworks/Mono.framework/Versions/4.0.0/bin/mcs /noconfig "/r:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/2.0/mscorlib.dll" -nostdlib "/out:/Users/borrrden/Development/couchbase-lite-net/src/Couchbase.Lite.Net35/bin/Release/Couchbase.Lite.dll" "/r:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/2.0/System.dll" "/r:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/2.0/System.Data.dll" "/r:/Users/borrrden/Development/couchbase-lite-net/src/Couchbase.Lite.Net35/vendor/SQLitePCL/SQLitePCL.raw.dll" "/r:/Users/borrrden/Development/couchbase-lite-net/src/Couchbase.Lite.Net35/vendor/SQLitePCL/ugly_net35.dll" "/r:/Users/borrrden/Development/couchbase-lite-net/src/Couchbase.Lite.Shared/vendor/Jint/Microsoft.Scripting.Core.dll" "/r:/Users/borrrden/Development/couchbase-lite-net/src/Couchbase.Lite.Net35/vendor/ICSharpCode/ICSharpCode.SharpZipLib.dll" "/r:/Users/borrrden/Development/couchbase-lite-net/src/p
@borrrden
borrrden / Replication_Tests.m
Created July 21, 2015 01:22
iOS implementation of .NET Issue 449 unit test
- (void)test18_pushAttachmentToCouchDB {
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://localhost:5984/issue449"]];
request.HTTPMethod = @"DELETE";
NSHTTPURLResponse *response = nil;
[NSURLConnection sendSynchronousRequest:request returningResponse:&response error:nil];
Assert(response.statusCode == 200 || response.statusCode == 404);
request.HTTPMethod = @"PUT";
[NSURLConnection sendSynchronousRequest:request returningResponse:&response error:nil];
Assert(response.statusCode == 201);
@borrrden
borrrden / c4DatabaseTest.cc
Created October 14, 2015 06:17
Unit test for issue
void testEnumerator()
{
C4Error err;
char docID[20];
for (int i = 1; i < 100; i++) {
sprintf(docID, "doc-%03d", i);
createRev(c4str(docID), kRevID, kBody);
}
createRev(C4STR("deleteme"), kRevID, kBody);
@borrrden
borrrden / keybase.md
Created March 15, 2016 21:23
Proof of my PGP identity

Keybase proof

I hereby claim:

  • I am borrrden on github.
  • I am borrrden (https://keybase.io/borrrden) on keybase.
  • I have a public key whose fingerprint is 490F 5156 F2BB 2031 61DE 0902 1962 A3AF 0194 A8D1

To claim this, I am signing this object:

Opening SQLite database using RevisionTrees
Writing docs took 297.840 ms for 12188 docs (24.437 us/doc, or 40921 docs/sec)
Indexing Albums/Artists views took 549.792 ms for 12188 docs (45.109 us/doc, or 22168 docs/sec)
Indexing Tracks view took 245.284 ms for 12188 docs (20.125 us/doc, or 49689 docs/sec)
Grouped query of Artist view took 47.072 ms for 12188 docs (3.862 us/doc, or 258920 docs/sec)
Opening ForestDB database using RevisionTrees
Writing docs took 328.516 ms for 12188 docs (26.954 us/doc, or 37100 docs/sec)
Indexing Albums/Artists views took 711.863 ms for 12188 docs (58.407 us/doc, or 17121 docs/sec)
Indexing Tracks view took 370.355 ms for 12188 docs (30.387 us/doc, or 32909 docs/sec)
Grouped query of Artist view took 54.193 ms for 12188 docs (4.446 us/doc, or 224898 docs/sec)
{"docs":[{"number":1919456320,"_id":"test_doc","_rev":"400-7d4b8a52e03a6f0fd47862c2eb6e1133","_revisions":{"start":400,"ids":["7d4b8a52e03a6f0fd47862c2eb6e1133","0ba7a64d25797c564cb9225c7d614547","23374b16de9eef8fc9c2eda636258574","d668d5eceea769d1ec32ee88bfc4108c","59334fec019bfb5098e2acb11244f9a1","efffb42d9ba17c687b534cc344450b27","bab59c95f7f84af1aa29ed2129a2fefd","67f4b190b0bcfcbc8b069091232a5a17","a67b175a90485d1adda9f447748875bc","80190efee757101726ac2dcf68d0275d","90962220732d0efa6cc3a44500e6397c","feab71372590e47a9b7062f316009142","f6aa8a19731c2159334dfcb91aa75cfb","73dda5b845b829579e3af04adae5cc44","6a669deb761804a0ff5ca7b4d2b6658b","3e32589087e676446cb59c9e8382b275","858c8696fa260845c63c4065c8a688c4","1f78400a5f3d7396d2e7bb8c19db16b2","0cd34184f9715492ae1d21e289b13906","d6f85be542ba19681a3f30afaf5196cf","81b86d0ba644ac02d0ff1f32655b1650","9fcb0f98f5e7eb43b251b4cd93a03f51","43ed6f78dbe9f52c752776173e346d48","1424d86110a50c3b476b6e7ac53e709c","12da45d9283214357c2582198b8ac035","90bbeab7e19e275532f784
{"docs":[{"_id":"test_doc","_rev":"200-d4269daf5193e23b4cdcb23bf5974510","number":904704968,"_revisions":{"ids":["d4269daf5193e23b4cdcb23bf5974510","2e5243a157904791021e543f8fed263b","7a843e29c44db34a79ace2e929b7042f","e05d7284b22d29c786630ee611cd8e32","a0909b5448e33c0e1b7be2b2d790f7f8","2b314935990c4292ce8d445f1e4a01b7","6e97d61d339e4c56f77b562546cc43c2","262ad65bcb19a3152a39a1222fedccad","fce375460a8a7fdd5117db54398b474e","7bba8951aab7f495b65b07a542411ed9","1a49269f80c866d89d3894a516418a50","439f631c1924acfd995c55e575e71adc","d684e890c41f80cd80a3d3c48eaf8fa8","9c7fce0e47730f1136576dae42a78e68","b06ee161146f501d07412457cac9b8ab","02e1c46d20d6bf920c9abc3fbb3be573","fd36e98e6b69c461b3863ce3fdda5421","6df42ab89f1b91ec13e15404fecc4a60","1d630ac1e729364a4e99cea1572262a4","165486c09ebb6a099ff3a733c011b0ba"],"start":200}}],"new_edits":false}