Skip to content

Instantly share code, notes, and snippets.

@sebastianhaas
sebastianhaas / gist:992c5eee016bca064341
Created Sep 3, 2015
Stack trace couchbase.lite exception
View gist:992c5eee016bca064341
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
View Stack trace without Autofac
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 Sep 29, 2015
LoopBack + AngularJS authentication solution
View auth.constants.js
(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 Sep 29, 2015
LoopBack + Angular authentication
View auth.service.js
(function() {
'use strict';
angular
.module('app.auth')
.factory('authService', authService);
authService.$inject = ['User', 'authEvents'];
/* @ngInject */
View median.cpp
// 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 Feb 26, 2016
Fixed math.js typings
View mathjs.d.ts
declare namespace MathJS {
interface Fraction {}
interface MathArray {}
interface Matrix {}
function config(options: any): void;
@sebastianhaas
sebastianhaas / Gruntfile.js
Created Mar 10, 2016
grunt-typings issue#2
View Gruntfile.js
module.exports = function(grunt) {
grunt.initConfig({
// refreshes ts definition files
typings: {
install: {}
},
});
grunt.loadNpmTasks('grunt-typings');
@sebastianhaas
sebastianhaas / can2udp.service
Created Aug 6, 2016
An example systemd unit file to run can2udp on startup
View can2udp.service
[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 Jan 30, 2017
.bootstraprc for bootstrap@4.0.0-alpha.6 with bootstrap-loader@2.0.0-beta.20
View .bootstraprc.yaml
---
# 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 Oct 30, 2017
Examplary Practice Session Result
View pbshare.html
<!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" />