Skip to content

Instantly share code, notes, and snippets.

View MatthewDavidCampbell's full-sized avatar

Matthew Campbell MatthewDavidCampbell

  • Swedish Connection
  • Sweden
View GitHub Profile
@MatthewDavidCampbell
MatthewDavidCampbell / Internal Expression
Created February 12, 2015 13:27
C# SQL Server Provider Not Creating the Correct Query
System.Data.Entity.Core.Objects.ObjectQuery`1[Charting.Models.BrandVisited])
.MergeAs(NoTracking)
.Select(Param_0 => new Dynamic-1664969929() {BrandVisited = Param_0})
.Join(
value(System.Data.Entity.Core.Objects.ObjectQuery`1[Charting.Models.BrandInfo])
.MergeAs(NoTracking)
, Outer => new Dynamic482297455() {BrandId = Outer.BrandVisited.BrandId}
, Inner => new Dynamic482297455() {BrandId = Inner.BrandId}
, (Outer, Inner) => new Dynamic-1664969929-347479675() {BrandInfo = Inner, BrandVisited = Outer.BrandVisited}
)
@MatthewDavidCampbell
MatthewDavidCampbell / Mocha JSX compiler
Last active August 29, 2015 14:20
React, Mocha, JSDom with Reflux
var fs = require('fs');
var ReactTools = require("react-tools");
require.extensions['.jsx'] = function (module, filename) {
var content;
content = fs.readFileSync(filename, 'utf8');
var compiled = ReactTools.transform(content, { harmony: true });
return module._compile(compiled, filename);
};
@MatthewDavidCampbell
MatthewDavidCampbell / Atom.cs
Created September 21, 2017 10:34
Rip of the Stark lexer
// Forked from The Stark Programming Language Contributors. All rights reserved.
// Licensed under the MIT license.
using System;
namespace Next.Services.Maps.Tokenize {
public struct Atom {
public static readonly Atom Done = new Atom(AtomType.Done, TextPosition.Done, TextPosition.Done);
@MatthewDavidCampbell
MatthewDavidCampbell / Grammer.cs
Created September 21, 2017 16:13
Rip of JHint's Pratt parser
using System;
using System.Collections.Generic;
using System.Linq;
using Next.Services.Maps.Tokenize;
using Next.Services.Maps.Tree;
namespace Next.Services.Maps.Parse {
public static class Grammer {
@MatthewDavidCampbell
MatthewDavidCampbell / HealthEndpoint.csproj
Created February 8, 2018 12:00
HealthCheck netstandard2.0
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Folder Include="wwwroot\" />
</ItemGroup>
@MatthewDavidCampbell
MatthewDavidCampbell / BackgroundThing.cs
Created February 8, 2018 14:18
HttpClientFactory netstandard2.0
using System;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
namespace HttpClientEndpoint
{
public class BackgroundThing : IHostedService, IDisposable
{
@MatthewDavidCampbell
MatthewDavidCampbell / ActiveMqInSprintTest.java
Created March 14, 2018 09:33
Example of JmsListenerEndpointRegistry and JmsTemplate
package sdc.ip.framework.spring.messaging;
import io.vertx.junit5.VertxExtension;
import io.vertx.junit5.VertxTestContext;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
@MatthewDavidCampbell
MatthewDavidCampbell / log
Created March 19, 2018 20:45
ServiceBusException on abandon message
aXBzdG9yYWdlZm9yYnVzLmJsb2IuY29yZS53aW5kb3dzLm5ldC9tcS1hZGFwdGVyLXBhcGluZXQtZGVsaXZlcnkvdHJhZGluZ2NvbnRyYWN0LzI4ZWIwNTBmLWM3OTEtNDYzZC04MmM4LTdhYTkzNGRlMTAwZj9zdj0yMDE3LTA0LTE3JnNyPWImc2lnPWZvVjU0d09uT2MxdyUyQjdFMEY3aVE1TktRdTVSenppSXNHbjdaaGdoTW5uZyUzRCZzdD0yMDE4LTAzLTE5VDExJTNBMDMlM0EzM1omc2U9MjAxOC0wNC0xOFQxMSUzQTA4JTNBMzNaJnNwPXJ
In0="}] {"resourceId":"7e94d020-c57e-45f1-b06f-1716ba3d7509","correlationId":"18246a58-418e-4e69-b51e-fa196e28ac87","callerId":"Tradingcontract"}
2018-03-19 16:43:14,615 ERROR [ForkJoinPool.commonPool-worker-3] sdc.ip.adapters.mq.messaging.DeliverCommandMessageReceiver[109]: No queue name defined in deliver command {"resourceId":"7e94d020-c57e-45f1-b06f-1716ba3d7509","correlationId":"18246a58-418e-4e69-b51e-fa196e28ac87","callerId":"Tradingcontract"}
2018-03-19 16:43:14,615 DEBUG [ForkJoinPool.commonPool-worker-3] sdc.ip.framework.spring.abstractions.internal.ApplicationContextActivator[168]: Application context disposed
2018-03-19 16:43:14,616 ERROR [ForkJoinPool.commonPool-work
@MatthewDavidCampbell
MatthewDavidCampbell / index.html
Created November 15, 2018 11:11
Adal.js access token for application id uri
<!DOCTYPE html>
<html>
<head>
<title>Use application id uri (PUT THIS UNDER public directory!)</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<style>body{font:normal normal normal 14px/1.5em "Century Gothic", sans-serif;}</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://secure.aadcdn.microsoftonline-p.com/lib/1.0.17/js/adal.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
@MatthewDavidCampbell
MatthewDavidCampbell / SJ Konversation
Last active June 17, 2019 16:02
SJ Interrail konversation om platsreservation för ett barn (7 år)
Din chattkonversation med SJ
Hej! Tack för att du kontaktade oss. Här kommer chattkonversationen du efterfrågade. Ha en bra dag!
Med vänliga hälsningar
SJ Kundservice
SJ Kundservice
Välkommen till vår kundservice!