Skip to content

Instantly share code, notes, and snippets.

@codedemonuk
codedemonuk / add-extra-buttons.js
Last active October 16, 2021 21:25
Basic javascript to add a a couple of extra buttons to the local plan page on the Hertsmere Local Plan website
function createHertsmereButton(linkText, url) {
const link = document.createElement("a");
link.href = url;
link.classList.add("hertsmereButton");
link.classList.add("hertsmereButtonTealFill");
link.appendChild(document.createTextNode(linkText));
const button = document.createElement("div");
button.classList.add("hertsmereTitleContainer--link-buttons");
button.appendChild(link);
@codedemonuk
codedemonuk / ConvertFrom-SSMParameterStoreSecureString.ps1
Last active April 2, 2021 18:03
Convert SSM Parameter Store from Secure String to String
#!/usr/bin/env pwsh
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[String]
$ParameterName
)
Write-Verbose -Message "Setting up PowerShell tools for AWS"

Keybase proof

I hereby claim:

  • I am codedemonuk on github.
  • I am pervez (https://keybase.io/pervez) on keybase.
  • I have a public key ASApQtAJYCGEyiDqsXwU1sih0r5ZzxmE0xa7tazeXTM3gwo

To claim this, I am signing this object:

@codedemonuk
codedemonuk / Import-Webcast.ps1
Last active March 24, 2023 23:19
Save a video from public-i.tv
#!/usr/bin/env pwsh
#requires -version 4
Param(
[Parameter(Mandatory=$True)]
[string]$Uri
)
Begin {}
Process {
@codedemonuk
codedemonuk / UpdateIISExpressSSLForChome.ps1
Created August 8, 2017 05:13 — forked from blowdart/UpdateIISExpressSSLForChome.ps1
IIS Express certs (for now) don't contain SAN strings. This makes Chrome unhappy. Make Chrome happy again with a new organic, artisanal, gluten free HTTPS certificate.
# Create a new self signed HTTPS Certificate for IIS Express
# Crafted with all organic, GMO, gluten free ingreditations
# with an artisinal SAN to make Chrome 58 onwards happy.
#
# See https://bugs.chromium.org/p/chromium/issues/detail?id=308330
#
# Run this at an administrative PowerShell prompt.
#
# You will be prompted to trust a new certificate via a windows dialog.
# Click yes otherwise Visual Studio will not be able to determine your
[CmdletBinding()]
param (
[string] $ApplicationName = "DemoWebsite",
[string] $Hostname = "demo-website.local"
)
$ErrorActionPreference = "Stop"
$protocol = "http"
$toolsFolder = "$PSScriptRoot\build\tools"
$nugetExe = "$toolsFolder\nuget\nuget.exe"
@codedemonuk
codedemonuk / Install-DevWebsite.ps1
Last active January 14, 2017 15:38
Easily set up a development website on your local windows IIS
[CmdletBinding()]
param (
[string] $ApplicationName = "DemoWebsite",
[int] $PortNumber = 80,
[string] $Hostname = "demo-website.local",
[string] $WebApplicationFolder = "$PSScriptRoot\src\$ApplicationName"
)
$ErrorActionPreference = "Stop"
$protocol = "http"
@echo off
:: Download NuGet
if not exist ".\build\tools" mkdir ".\build\tools"
if not exist ".\build\tools\nuget" mkdir ".\build\tools\nuget"
if not exist ".\build\tools\nuget\nuget.exe" powershell -Command "Invoke-WebRequest https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -OutFile .\build\tools\nuget\nuget.exe"
:: Download Psake
set nuget=.\build\tools\nuget\nuget.exe
set EnableNuGetPackageRestore=true
private readonly string _slackKey = "<Your API Token>";
private readonly ILog _log = LogManager.GetCurrentClassLogger();
private void ConnectToSlackIfDisconnected(bool isConnected)
{
if (!isConnected)
{
Task.Factory.StartNew(async () =>
{
while (!_bot.IsConnected)
@codedemonuk
codedemonuk / CastleWindsorHttpHandlerFactory.cs
Created January 14, 2017 00:26
ASP.Net HTTP Handler Factory for Castle Windsor
public class CastleWindsorHttpHandlerFactory : IHttpHandlerFactory
{
private static IWindsorContainer _container;
public CastleWindsorHttpHandlerFactory()
{
if (_container == null)
{
_container = ((IContainerAccessor)HttpContext.Current.ApplicationInstance).Container;
}