This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl http://localhost:3000/socket.io/1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Replace the old headers with the new ones. | |
# Find all csharp files, recursively. | |
# If it has an old header, remove it. | |
# Then insert the new header which includes | |
# the current file's name. | |
for file in $(find . -type f -name '*.cs'); do | |
fileName=${file##*/} # Split on the path char, and take the last segment. | |
headerStart='1i \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# begin build properties | |
# autogenerated by buildinfo.sh | |
ro.build.id=JWR66N | |
ro.build.display.id=JWR66N | |
ro.build.version.incremental=711294 | |
ro.build.version.sdk=18 | |
ro.build.version.codename=REL | |
ro.build.version.release=4.3 | |
ro.build.date=Sat Jun 15 19:53:50 UTC 2013 | |
ro.build.date.utc=1371326030 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openssl x509 -outform der -in cert.pem -out cert.der |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void PutNPeople(Database db, int n) | |
{ | |
var lastNames = new[] { "Gramana", "Johnson", "Hunter", "Carter" }; | |
var firstNames = new[] { "Zack", "Bryan", "Greg", "Wayne" }; | |
for (int i = 0; i < n; i++) | |
{ | |
var doc = new Dictionary<string, object> | |
{ | |
{ "firstName", firstNames[i % 4] }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adapted from http://code.activestate.com/recipes/442473-simple-http-server-supporting-ssl-secure-communica/ | |
''' | |
SimpleSecureHTTPServer.py - simple HTTP server supporting SSL. | |
- replace fpem with the location of your .pem server file. | |
- the default port is 443. | |
usage: python SimpleSecureHTTPServer.py | |
''' | |
import socket, os |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "product-recommendations", | |
"product-id": "111", | |
"recommendations": [ | |
{ | |
"_id": "222", | |
"name": "Handy Hammer", | |
"min_price": 3.45, | |
"currency": "USD", | |
"quantity": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void CreateDatabase () | |
{ | |
_db = Manager.SharedInstance.GetExistingDatabase (DATABASE_NAME); | |
if (_db == null) | |
{ | |
var assembly = Assembly.GetCallingAssembly (); | |
var resourceName = assembly | |
.GetManifestResourceNames() | |
.Where (x => x.EndsWith("couchbase-connect.cblite")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (doc.type == "contactexchange") { | |
// trade access to each user's contact channel | |
access(doc.userId, "contact-" + doc.localUserId); | |
access(doc.localUserId, "contact-" + doc.userId); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading.Tasks; | |
using System.Threading; | |
namespace Couchbase.Lite.Shared | |
{ | |
public static class TaskExtensions | |
{ | |
static int CheckTimeout (TimeSpan timeout) | |
{ |