Skip to content

Instantly share code, notes, and snippets.

View niemyjski's full-sized avatar
😀

Blake Niemyjski niemyjski

😀
View GitHub Profile
@niemyjski
niemyjski / gist:e0bb970cc5ea59a28a79
Last active August 29, 2015 14:21
JavaScript/TypeScript plugin pipeline
function plugin1(context, next) {
console.log('plugin1');
console.log(context.event);
next();
}
function plugin2(context, next) {
console.log('plugin2');
someIO(next);
}
@niemyjski
niemyjski / gist:2007783
Created March 9, 2012 18:02
Visual SVN Crash
Unexpected exception: Object reference not set to an instance of an object.
at Microsoft.VisualStudio.Editor.Implementation.VsTextBufferAdapter.GetData_VsBufferEncoding()
at Microsoft.VisualStudio.Editor.Implementation.VsTextBufferAdapter.GetData(Guid& riidKey, Object& pvtData)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at Microsoft.VisualStudio.VSIP.NativeMethods.ThrowOnFailure(Int32 hr, Int32[] expectedHRFailure)
at VisualSVN.VS.AbstractLockedTextBuffer.GetEncoding()
at VisualSVN.Core.MarkerBuilder.BuildMarkers(ILockedTextBuffer lockedTextBuffer, IFileContentProvider fileContentProvider, IBufferContentProvider bufferContentProvider, IsPathVersionedDelegate isPathVersioned, Client client)
at VisualSVN.Core.QuickDiffUpdater.BuildMarkers(ILockedTextBuffer lockedTextBuffer)
at VisualSVN.Core.QuickDiffUpdater.Process()
StackTrace:
@niemyjski
niemyjski / ProxySubmissionClient.cs
Created October 1, 2015 23:41
Setting Exceptionless proxy settings during runtime
// Override the default submission client
public class ProxySubmissionClient : SubmissionClient {
protected override HttpWebRequest CreateHttpWebRequest(ExceptionlessConfiguration config, string endPoint) {
var request = base.CreateHttpWebRequest(config, endPoint);
// Set the proxy info here.
try {
request.Proxy = new WebProxy("MyProxyAddress");
} catch (Exception) {}
@niemyjski
niemyjski / FailWidget.html
Created December 9, 2015 00:20 — forked from theit8514/FailWidget.html
Shows error .plugin/e.fn[c]/<@http://kendo.cdn.telerik.com/2015.3.930/js/kendo.all.min.js:10
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled</title>
<link rel="stylesheet" href="http://kendo.cdn.telerik.com/2015.3.930/styles/kendo.common.min.css">
<link rel="stylesheet" href="http://kendo.cdn.telerik.com/2015.3.930/styles/kendo.rtl.min.css">
<link rel="stylesheet" href="http://kendo.cdn.telerik.com/2015.3.930/styles/kendo.default.min.css">
<link rel="stylesheet" href="http://kendo.cdn.telerik.com/2015.3.930/styles/kendo.mobile.all.min.css">
using System;
using System.Linq.Expressions;
using System.Reflection;
using WebApi.Delta;
namespace Hst.Deals.API.Infrastructure
{
internal class CompiledPropertyAccessor<TEntityType> : PropertyAccessor<TEntityType> where TEntityType : class
{
private Action<TEntityType, object> _setter;
@niemyjski
niemyjski / .profile
Created April 6, 2016 14:21 — forked from bmhatfield/.profile
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
@niemyjski
niemyjski / cliff-notes.md
Created April 28, 2016 12:25 — forked from shiftkey/cliff-notes.md
Working Distributed - Cliff Notes
@niemyjski
niemyjski / Example1.cs
Created May 19, 2016 17:26 — forked from davidfowl/Example1.cs
How .NET Standard relates to .NET Platforms
namespace Analogy
{
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
{
public void Net45Application(INetFramework45 platform)
@niemyjski
niemyjski / DiagnoseRedisErrors-ClientSide.md
Created July 19, 2016 11:36 — forked from JonCole/DiagnoseRedisErrors-ClientSide.md
Diagnosing Redis errors caused by issues on the client side

Diagnosing Redis errors on the client side

Customers periodically ask "Why am I getting errors when talking to Redis". The answer is complicated - it could be a client or server side problem. In this article, I am going to talk about client side issues. For server side issues, see here

Clients can see connectivity issues or timeouts for several reason, here are some of the common ones I see:


###Memory pressure

@niemyjski
niemyjski / RemoveSensitivePostDataPlugin.cs
Last active August 9, 2016 14:33
Exceptionless Plugin to remove sensitive string post data
// Sometimes post data cannot be converted (non form data) so we serialize it to a stirng.
// This plugin adds some overhead as you are checking post data (really large string)
[Priority(100)]
internal class RemoveSensitivePostDataPlugin : IEventPlugin {
public void Run(EventPluginContext context) {
var serializer = context.Client.Configuration.Resolver.GetJsonSerializer();
var ri = context.Event.GetRequestInfo(serializer);
string data = ri != null ? ri.PostData as string : null;
if (data == null)