Skip to content

Instantly share code, notes, and snippets.

Zachary Gramana zgramana

Block or report user

Report or block zgramana

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@zgramana
zgramana / Install.md
Created Jan 7, 2017 — forked from chirag04/Install.md
compile rocksdb as backend for asyncstorage
View Install.md

Credits

All credit to @sahrens for sharing fb's internal implementation.

Setup

  • clone rocksdb from https://github.com/facebook/rocksdb.

  • edit MakeFile inside rocksdb. Search for Platform-specific compilation around line 1122. Make th next few lines to look like this:

ifeq ($(PLATFORM), IOS)
# For iOS, create universal object files to be used on both the simulator and
View word2vec.fsx
#I "../packages/"
#r @"FSharp.Data/lib/net40/FSharp.Data.dll"
#r @"StemmersNet/lib/net20/StemmersNet.dll"
#r @"FSharp.Collections.ParallelSeq/lib/net40/FSharp.Collections.ParallelSeq.dll"
#load "Utilities.fs"
open FSharp.Data
@zgramana
zgramana / LICENSE
Created Jul 12, 2016 — forked from kerryrodden/.block
Sequences sunburst
View LICENSE
Copyright 2013 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
@zgramana
zgramana / auto-merge.cs
Created Apr 12, 2016
Auto-merging conflicting revisions in C# using LINQ
View auto-merge.cs
Dictionary<string, object> mergedProps;
try
{
mergedProps = doc.ConflictingRevisions
.SelectMany(rev => rev.UserProperties)
.Distinct()
.ToDictionary(
kvp => kvp.Key,
kvp => kvp.Value
@zgramana
zgramana / swagger.json
Last active Jan 26, 2016
Init POC of generated Swagger spec
View swagger.json
{
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"schemes": [
"http",
"https"
@zgramana
zgramana / package.sh
Created Aug 11, 2015
Creates a standalone OSX executable of our cp-replicate .NET app.
View package.sh
#!/bin/sh
export AS="as -arch i386”
export CC="cc -framework CoreFoundation -lobjc -liconv -arch i386”
mkbundle --deps --static -o cb-replicate cbreplicate.exe *.dll
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/pkgconfig:/Library/Frameworks/Mono.framework/Versions/Current/lib/pkgconfig
export LD_LIBRARY_PATH=/Library/Frameworks/Mono.framework/Versions/Current/lib/
cd /Users/zgramana/Source/cb-replicate/bin/Release/
mkbundle--deps --static -o cb-replicate cbreplicate.exe *.dll
@zgramana
zgramana / get_changes.go
Created May 23, 2015
Gets the changes feed and prints the results.
View get_changes.go
package main
import "fmt"
import "io/ioutil"
import "net/http"
func main() {
// Changes Feed (GET http://127.0.0.1:4984/db/_changes?feed=longpoll&limit=50&heartbeat=300000&style=all_docs&since=1&include_docs=false)
@zgramana
zgramana / couchbase-lite-demo.csx
Last active Aug 29, 2015
Simple first script to create a bunch of docs and replicate them.
View couchbase-lite-demo.csx
// Run `scriptcs -install Couchbase.Lite` to fetch Couchbase Lite from Nuget.
#r Couchbase.Lite.dll
using Couchbase.Lite;
var db = Manager.SharedInstance.GetDatabase("scriptcs");
db.RunInTransaction(()=>
{
@zgramana
zgramana / TaskExtensions.cs
Last active Aug 29, 2015
Task.Delay backport
View TaskExtensions.cs
using System;
using System.Threading.Tasks;
using System.Threading;
namespace Couchbase.Lite.Shared
{
public static class TaskExtensions
{
static int CheckTimeout (TimeSpan timeout)
{
@zgramana
zgramana / info_swap.js
Created Dec 9, 2014
Sync Function Snippets
View info_swap.js
if (doc.type == "contactexchange") {
// trade access to each user's contact channel
access(doc.userId, "contact-" + doc.localUserId);
access(doc.localUserId, "contact-" + doc.userId);
}
You can’t perform that action at this time.