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
@GuyPaddock
GuyPaddock / RenewAzureAdProxyCert.ps1
Last active February 1, 2024 22:06
PowerShell Script to Renew the SSL Certificate Used by the Application Proxy for an Azure AD Enterprise Application
################################################################################
# Script that renews a Let's Encrypt certificate for the Application Proxy of an
# Enterprise Application.
################################################################################
# This script can be run standalone from your local machine to automate the
# steps of a specific ACME renewal for Azure AD App Proxy application.
#
# Prior to using this script, you will need to ensure you have a DNS zone setup
# that points to your Azure AD App Proxy deployment. Azure AD will give you a
# hostname that will need to be referenced by a CNAME record in the zone. So,
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@MikeBild
MikeBild / app.js
Last active October 30, 2016 06:22
Memoize - you never need constructor/property based dependency injection in JavaScript
const require1 = require('./require1');
const require2 = require('./require2');
const require3 = require('./require3');
console.log(require1.getValue());
console.log(require2.getValue());
console.log(require3.getValue());

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 / 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.

This Gist contains the script and generated output file for an Acer B276HUL.

The pre-generated file below is known to work with:

  • OS X Mavericks
  • OS X Yosemite
  • OS X El Capitan

For El Capitan:

  1. Restart your Mac while holding Command-R: this puts your Mac into Recovery Mode.
@mariusschulz
mariusschulz / ExternalJavaScriptFileAttribute.cs
Last active April 16, 2020 15:24
Here's the ExternalJavaScriptFileAttribute that I showed in my blog post "Generating External JavaScript Files Using Partial Razor Views" (see http://blog.mariusschulz.com/generating-external-javascript-files-using-partial-razor-views).
using System;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Web.Mvc;
namespace DemoApp
{
public class ExternalJavaScriptFileAttribute : ActionFilterAttribute
{
@jbtule
jbtule / LosslessJson.csx
Created May 25, 2013 01:37
This example was inspired by "Serialization is Lossy" http://kellabyte.com/2013/05/02/serialization-is-lossy/
using ImpromptuInterface;
using Newtonsoft.Json.Linq;
/*
* This example was inspired by
* "Serialization is Lossy"
* http://kellabyte.com/2013/05/02/serialization-is-lossy/
*/
@gfraiteur
gfraiteur / gist:1834882
Created February 15, 2012 10:16
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
{
@jcsrb
jcsrb / gist:1081548
Created July 13, 2011 23:05
get avatar from google profiles, facebook, gravatar, twitter, tumblr
function get_avatar_from_service(service, userid, size) {
// this return the url that redirects to the according user image/avatar/profile picture
// implemented services: google profiles, facebook, gravatar, twitter, tumblr, default fallback
// for google use get_avatar_from_service('google', profile-name or user-id , size-in-px )
// for facebook use get_avatar_from_service('facebook', vanity url or user-id , size-in-px or size-as-word )
// for gravatar use get_avatar_from_service('gravatar', md5 hash email@adress, size-in-px )
// for twitter use get_avatar_from_service('twitter', username, size-in-px or size-as-word )
// for tumblr use get_avatar_from_service('tumblr', blog-url, size-in-px )
// everything else will go to the fallback
// google and gravatar scale the avatar to any site, others will guided to the next best version