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 / 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!")]
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\WindowsUpdate\AU]
"NoAutoRebootWithLoggedOnUsers"=dword:00000001
@JohannesHoppe
JohannesHoppe / Disable_Windows_Narrator_on_Windows8.reg
Created December 28, 2014 15:48
How to disable Windows Narrator appearing on Win-Enter in Windows 8
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Narrator.exe]
"Debugger"="%1"

Angular2 + JSPM cheat sheet

First time setup

  • install jspm beta: npm install -g jspm@beta
  • set up your project: jspm init
  • install dependencies: jspm install angular2 reflect-metadata zone.js es6-shim

This will create a jspm_packages folder, and a config.js file.

Open the config.js file - this file manages options for the System.js loader - tweak it as appropriate

@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 / 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 / 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 = {