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 */
@sebastianhaas
sebastianhaas / user.json
Created Oct 1, 2015
LoopBack User Friendship
View user.json
{
"name": "user",
"plural": "users",
"base": "User",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {},
"validations": [],
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 / socketcan-interface.service
Created Aug 6, 2016
An example systemd unit file to setup a SocketCAN interface on startup
View socketcan-interface.service
[Unit]
Description=SocketCAN interface can0 with a baudrate of 250000
After=multi-user.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/sbin/ip link set can0 type can bitrate 250000 ; /sbin/ifconfig can0 up
ExecReload=/sbin/ifconfig can0 down ; /sbin/ip link set can0 type can bitrate 250000 ; /sbin/ifconfig can0 up
ExecStop=/sbin/ifconfig can0 down