Skip to content

Instantly share code, notes, and snippets.

View rionmonster's full-sized avatar

Rion Williams rionmonster

View GitHub Profile
@rionmonster
rionmonster / Events Processing
Created January 29, 2020 05:34
Users Preprocessing
object EventProcessing {
@JvmStatic
fun main(args: Array<String>) {
val streamsManager = StreamsManager()
// Get the events, we need those to enrich with
val eventProcessor = EventProcessor()
// The raw events that originated everything
@rionmonster
rionmonster / GuaranteedStreamSideJoinTransformer.kt
Created November 5, 2019 22:25
Examples of Custom KStream-KTable Joins to Handle Slowly Loading KTables
package streams.common.kafka.transformers
import org.apache.kafka.streams.KeyValue
import org.apache.kafka.streams.kstream.Transformer
import org.apache.kafka.streams.state.ValueAndTimestamp
import org.apache.kafka.streams.processor.PunctuationType
import org.apache.kafka.streams.state.KeyValueStore
import org.apache.kafka.streams.processor.ProcessorContext
import org.apache.kafka.streams.kstream.TransformerSupplier
import java.time.Duration
@rionmonster
rionmonster / bearded-borb.svg
Last active June 29, 2017 14:46
Various Borbs for Your Editing Pleasure
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<entry>
<record>513</record>
<time>2017/06/27 18:36:10.340</time>
<type>Error</type>
<source>Editor or Editor Extension</source>
<description>Microsoft.VisualStudio.ExtensibilityHosting.InvalidMEFCacheException: The Visual Studio component cache is out of date (assembly: Glyphfriend.VS2017, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null). Please restart Visual Studio.&#x000D;&#x000A; at Microsoft.VisualStudio.ExtensibilityHosting.FaultCatchingAssemblyLoader.&lt;&gt;c__DisplayClass17_0.&lt;LoadAssembly&gt;b__0(AssemblyName assemblyNameParam)&#x000D;&#x000A; at Microsoft.VisualStudio.ExtensibilityHosting.Utilities.SafeGetOrAdd[TKey,TValue](IDictionary`2 dictionary, TKey key, Object lockObj, Func`2 valueFactory)&#x000D;&#x000A; at Microsoft.VisualStudio.ExtensibilityHosting.FaultCatchingAssemblyLoader.LoadAssembly(AssemblyName assemblyName)&#x000D;&#x000A; at Microsoft.VisualStudio.Composition.Reflection.ResolverExtensions.Resolve(ConstructorRef constructorRef)&#x000D;&#x000A;
@rionmonster
rionmonster / gist:4c06971efa08d654cd88ae0c18db611f
Created May 19, 2017 14:12
Can you embed images within dev.to posts?
<!-- HTML Approach -->
<a href='link'><img src='image-url' alt='image-alt-text'/></a>
<!-- Markdown Approach -->
[![image-alt-text](image-url)](link)
@rionmonster
rionmonster / Example.csx
Created April 18, 2017 15:36
Should this be possible?
// This throws a "The type or namespace name 'Dictionary<,>' could not be found" compilation exception
Config.Settings = new Dictionary<string, string>()
{
{ "Foo", "Bar" }
};
[HttpPost]
[SwaggerOperation("create-member")]
[SwaggerResponse(200)]
[SwaggerResponse(400, Description = "Invalid Parameters")]
public void Create(MemberData member)
{
// This works
}
[HttpPost]
// Index route, which I added route parameter to include ID
[HttpGet("estimate/{project_ID}")]
public IActionResult Index(int project_ID)
{
// Any specific reason for the Session? Could
// this be resolved from the current user / claims?
if(HttpContext.Session.GetInt32("userID") == null)
{
return RedirectToAction("Index", "User");
}
@rionmonster
rionmonster / gist:b52e4ed03754714acfedcba39ea8fc92
Created February 11, 2017 00:51
Instructions to blow up VS2017 Install
1. Uninstall VS and the VS installer (if you haven’t already).
2. Delete C:\ProgramData\Microsoft\VisualStudio.
3. Delete %localappdata%\Microsoft\VisualStudio.
4. Delete %appdata%\Microsoft\VisualStudio.
5. Open regedit and delete (if they exist):
a. HKLM\SOFTWARE\Microsoft\VisualStudio\15.0
b. HKLM\SOFTWARE\WoW6432Node\Microsoft\VisualStudio\15.0
c. HKCU\SOFTWARE\Microsoft\VisualStudio\15.0*
@rionmonster
rionmonster / ToggleLibraryCommand.cs
Last active February 1, 2017 20:03
Example Static Menuing In Glyphfriend
using System;
using System.ComponentModel.Design;
using Microsoft.VisualStudio.Shell;
using System.Collections.Generic;
namespace Glyphfriend.VS2017
{
internal sealed class ToggleLibraryCommand
{
public static readonly Guid CommandSet = new Guid("2cd75fc6-9478-422d-ab4b-022fc5fde9bf");