Skip to content

Instantly share code, notes, and snippets.

using System;
using System.IO;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading;
using System.Threading.Tasks;
@innovia
innovia / kubernetes_add_service_account_kubeconfig.sh
Last active January 29, 2024 23:00
Create a service account and generate a kubeconfig file for it - this will also set the default namespace for the user
#!/bin/bash
set -e
set -o pipefail
# Add user to k8s using service account, no RBAC (must create RBAC after this script)
if [[ -z "$1" ]] || [[ -z "$2" ]]; then
echo "usage: $0 <service_account_name> <namespace>"
exit 1
fi
@kamsar
kamsar / Performance.Dev.config
Last active August 17, 2021 16:04
SItecore 8.0/8.1/8.2 Performance Config
<!--
A set of performance optimizations for development that vastly increase application startup time.
Should not be used in production, as they largely disable forensic diagnostics that you'd want there over fast startup time after a compile.
-->
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<hooks>
<hook type="Sitecore.Diagnostics.HealthMonitorHook, Sitecore.Kernel">
<patch:delete />
@manadart
manadart / 01_GreetingAspect.cs
Created March 25, 2011 08:22
Example usage of TinyIoC - the first with constructor injection, the second with property injection.
namespace TinyIoCDemo
{
// This is the interface for my aspect - the dependency for my classes.
public interface IAspectDependency
{
string GetGreeting();
}
// And here is an implementation.
public class GreetingAspect : IAspectDependency