Skip to content

Instantly share code, notes, and snippets.

@sebastianhaas
sebastianhaas / gist:992c5eee016bca064341
Created September 3, 2015 09:39
Stack trace couchbase.lite exception
SetUp : Autofac.Core.DependencyResolutionException : An exception was thrown while invoking the constructor 'Void .ctor()' on type 'CouchbaseLiteLibraryFactory'. ---> An exception was thrown by the type initializer for Couchbase.Lite.Manager (See inner exception for details.)
----> System.TypeInitializationException : An exception was thrown by the type initializer for Couchbase.Lite.Manager
----> System.TypeInitializationException : An exception was thrown by the type initializer for Couchbase.Lite.ManagerOptions
----> System.TypeInitializationException : An exception was thrown by the type initializer for System.Net.ServicePointManager
----> System.Configuration.ConfigurationErrorsException : Error Initializing the configuration system.
----> System.Threading.ThreadAbortException : Thread was being aborted
TearDown : System.NullReferenceException : Object reference not set to an instance of an object
SetUp : System.TypeInitializationException : An exception was thrown by the type initializer for System.Collections.Generic.List`1
----> System.TypeLoadException : Could not load type 'Couchbase.Lite.Replication[]' from assembly 'Couchbase.Lite, Version=1.1.1.0, Culture=neutral, PublicKeyToken=null'.
TearDown : System.NullReferenceException : Object reference not set to an instance of an object
at Couchbase.Lite.Manager..ctor (System.IO.DirectoryInfo directoryFile, Couchbase.Lite.ManagerOptions options) [0x00000] in <filename unknown>:0
at Couchbase.Lite.Manager.get_SharedInstance () [0x00000] in <filename unknown>:0
at PhonicScore.LibraryCouchbaseLite.CouchbaseLiteLibraryFactory..ctor () [0x00007] in /Users/sebastian/Documents/Development/PhonicScore/_Common/Library/CouchbaseLiteLibraryFactory.cs:20
at PhonicScore.Tests.Library.TestLibrarySheet.SetUp () [0x00022] in /Users/sebastian/Documents/Development/PhonicScore/_Common/Tests/Library_Tests/TestLibrarySheet.cs:37
at (wrapper managed-to-na
@sebastianhaas
sebastianhaas / auth.constants.js
Last active September 29, 2015 10:46
LoopBack + AngularJS authentication solution
(function() {
'use strict';
angular
.module('app.auth')
.constant('authEvents', {
LOGIN_SUCCESS: 'auth_login_success',
LOGIN_FAILED: 'auth_login_failed',
LOGOUT_SUCCESS: 'auth_logout_success',
LOGOUT_FAILED: 'auth_logout_failed',
@sebastianhaas
sebastianhaas / auth.service.js
Created September 29, 2015 21:21
LoopBack + Angular authentication
(function() {
'use strict';
angular
.module('app.auth')
.factory('authService', authService);
authService.$inject = ['User', 'authEvents'];
/* @ngInject */
@sebastianhaas
sebastianhaas / median.cpp
Created January 4, 2016 17:20
C++ - Java Median
// Compute the median with std::nth_element
template<class T>
T vtkComputeMedianOfArray(T *aBegin, T *aEnd)
{
T *aMid = aBegin + (aEnd - aBegin)/2;
std::nth_element(aBegin, aMid, aEnd);
T m = *aMid;
// if even size, get max of lower part of array and compute the average
if (aMid - aBegin == aEnd - aMid)
@sebastianhaas
sebastianhaas / mathjs.d.ts
Created February 26, 2016 10:18
Fixed math.js typings
declare namespace MathJS {
interface Fraction {}
interface MathArray {}
interface Matrix {}
function config(options: any): void;
@sebastianhaas
sebastianhaas / Gruntfile.js
Created March 10, 2016 08:19
grunt-typings issue#2
module.exports = function(grunt) {
grunt.initConfig({
// refreshes ts definition files
typings: {
install: {}
},
});
grunt.loadNpmTasks('grunt-typings');
@sebastianhaas
sebastianhaas / can2udp.service
Created August 6, 2016 15:01
An example systemd unit file to run can2udp on startup
[Unit]
Description=can2udp
After=multi-user.target socketcan-interface.service
Requires=socketcan-interface.service
[Service]
Type=simple
ExecStart=/home/pi/development/railroad/can2udp/src/can2udp -f -v
[Install]
@sebastianhaas
sebastianhaas / .bootstraprc.yaml
Created January 30, 2017 10:21
.bootstraprc for bootstrap@4.0.0-alpha.6 with bootstrap-loader@2.0.0-beta.20
---
# Output debugging info
# loglevel: debug
# Major version of Bootstrap: 3 or 4
bootstrapVersion: 4
# If Bootstrap version 4 is used - turn on/off flexbox model
useFlexbox: true
@sebastianhaas
sebastianhaas / pbshare.html
Last active October 30, 2017 09:09
Examplary Practice Session Result
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Sebastian's Practice Bird Score</title>
<meta property="og:title" content="Sebastian's Practice Bird Score" />
<meta property="og:description" content="Sebastian's just finished playing Air by Johann Sebastian Bach" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://your localtunnel/pst share url" />
<meta property="og:image" content="https://targetjobs.co.uk/sites/targetjobs.co.uk/files/public/field_ad_org_logo/birdandbird-logo.gif" />