Skip to content

Instantly share code, notes, and snippets.

FROM centos:latest AS libgit2-15e1193
RUN yum install -y git
RUN yum install -y cmake gcc make openssl-devel
RUN git clone --recursive https://github.com/libgit2/libgit2sharp.nativebinaries /nativebinaries
WORKDIR /nativebinaries
# Latest commit that will produce libgit2-15e1193
RUN git checkout e6fde40
# Build lib files and output them under ./libgit2/build/*
RUN ./build.libgit2.sh
@PaulMilla
PaulMilla / Test-JsonSchema.ps1
Created February 6, 2019 00:20
Uses Newtonsoft.Json.dll & Newtonsoft.Json.Schema.dll to validate a json against its schema
param (
[string]$targetFramework = 'net45'
)
$ErrorActionPreference = 'Stop'
function Install-Package($name, $version)
{
if (!(Test-Path "$PSScriptRoot\$name.$version\**\$targetFramework\$name.dll"))
{
@PaulMilla
PaulMilla / CouchbaseWalIssue.cs
Created February 20, 2018 22:09
Test case demonstrating WAL file size growth. Tested on Couchbase.Lite 1.4.0 & 1.4.1
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Couchbase.Lite;
using Couchbase.Lite.Util;
namespace CouchbaseWalIssue
{
public class Program
@PaulMilla
PaulMilla / CouchbaseLite2.cs
Created April 26, 2017 20:21
Couchbase Lite implementation that connects to another Couchbase Lite app and replicates data
internal class Program
{
private const string DB_NAME = "app2";
private const string OTHER_DB_NAME = "app1";
private const string OTHER_DB_IP = "127.0.0.1";
private const ushort OTHER_DB_PORT = 59840;
private static readonly Uri OtherUrl = new Uri($"http://{OTHER_DB_IP}:{OTHER_DB_PORT}/{OTHER_DB_NAME}");
@PaulMilla
PaulMilla / CouchbaseLite1.cs
Created April 26, 2017 20:19
Couchbase Lite implementation that sets up a listener for P2P replication
internal class Program
{
private const string DB_NAME = "app1";
private const ushort DB_PORT = 59840;
private static Manager manager;
private static Database db;
private static void Main()
{
@PaulMilla
PaulMilla / Update-NugetPackage.ps1
Last active December 6, 2016 17:45
Runs nuget.exe update on a a package and updates all csprojects in the solution
param(
[Parameter(Mandatory=$true)]$package,
$solution = (Get-Item *.sln),
$nuget = "nuget.exe"
)
& $nuget update "$solution" -Id "$package"
$sln = Get-Content $solution
[regex]$regex = 'Project\("{.*?}"\) = ".*?", "(.*?\.csproj)", "{.*?}"'