Skip to content

Instantly share code, notes, and snippets.

View szahn's full-sized avatar

Stuart Zahn szahn

View GitHub Profile
anonymous
anonymous / TokenValidator.cs
Created September 21, 2015 16:16
Validate JSON Web Token (JWT) With .NET JWT Library
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.IdentityModel.Tokens;
using System.Linq;
using System.Net.Http;
using System.Security.Cryptography.X509Certificates;
using System.Text;
import React from "react";
import { render } from "react-dom";
const ParentComponent = React.createClass({
getDefaultProps: function() {
console.log("ParentComponent - getDefaultProps");
},
getInitialState: function() {
console.log("ParentComponent - getInitialState");
return { text: "" };
@wojteklu
wojteklu / clean_code.md
Last active June 13, 2024 21:46
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@techbunny
techbunny / ContainersYourWay_StartHere.md
Last active September 13, 2017 18:09
Getting Started with Containers from MTX

Getting Started with Containers - Your Way

Here you can find a list of some quick tutorials and sample code to get you going quickly with containers on Azure.

On Your Computer

To quickly get started creating containers on your computer, download either Docker for Windows or Docker for Mac. One of the cool features of Docker for Windows is the ability to switch between Linux and Windows containers.

To get started creating containers with Docker, I recommend their Getting Started with Docker guide.

@artisticcheese
artisticcheese / Dockerfile
Last active June 2, 2021 13:03
Dockerfile to build IIS + nanoserver + ASP.NET core
# escape=`
# Image with NET CORE installation to extract executables for final image
FROM microsoft/aspnetcore:2.0.0-nanoserver As CoreBuild
# Middleware image used to extract ASP.NET core module
From microsoft/iis as WindowsBuild
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'Continue'; $verbosePreference='Continue';"]
# Installing NET CORE webhosting in middleware image so latest module and configuration schema is extracted for final image
ADD https://download.microsoft.com/download/B/1/D/B1D7D5BF-3920-47AA-94BD-7A6E48822F18/DotNetCore.2.0.0-WindowsHosting.exe ".\hosting.exe"
@to-var
to-var / install.sh
Created August 23, 2018 15:28
An Oh-my-zsh theme installer helper. Put this file on the same folder as a downloaded theme, then run `sh install.sh [theme-you-want-to-install]`
#!/bin/bash
# Colors
RED="\033[0;31m"
ORANGE="\033[0;33m"
GREEN="\033[0;32m"
NC="\033[0m"
# Messages
OK="[OK]"