Skip to content

Instantly share code, notes, and snippets.

View Guzzter's full-sized avatar
🏠
Working from home

Guus Beltman Guzzter

🏠
Working from home
View GitHub Profile
export default function createExternalRoot(rootElement) {
const inputSelector = "input[data-testid*=searchbox]";
return {
render(props) {
rootElement.innerHTML = `<style>
.inputBoxHelpText {
display: none;
color: #FFF;
background: #4B4B4B;
border-radius: 6px !important;
@Guzzter
Guzzter / settings.json
Created April 24, 2020 17:05
Windows Terminal Settings JSON
// This file was initially generated by Windows Terminal 0.11.1121.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"alwaysShowTabs": true,
@Guzzter
Guzzter / xunit_fact.snippet
Created March 1, 2019 08:40 — forked from marcduiker/xunit_fact.snippet
Visual Studio C# snippet for xUnit test methods (Facts) using the naming convention proposed by http://osherove.com/blog/2005/4/3/naming-standards-for-unit-tests.html. Import the snippet using the SnippetManager in VS and type `fact[tab][tab]` inside a class to insert the snippet.
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
<Title>xUnit Fact</Title>
<Shortcut>fact</Shortcut>
<Description>Code snippet for an xUnit test method (Fact) following the naming convention UnitOfWork_StateUnderTest_ExpectedBehaviour.</Description>
@Guzzter
Guzzter / RestartTridion2013Services.ps1
Created November 24, 2016 10:06
Stop and Start Tridion 2013 services
Write-Host "Restarting all Tridion Services"
Get-Service -displayname Tri* | Stop-Service -force
Get-Service -displayname Tri* | Start-Service
Write-Host "Restarting IIS"
iisreset
pause
@Guzzter
Guzzter / SDLWeb8PowerShellProfile.ps1
Last active July 22, 2016 10:58
Powershell profile script for starting and stopping SDL Web 8 (a.k.a. Tridion) services
######################################################################################
# SDLWeb8PowerShellProfile.ps1
# Description: Powershell profile script for starting and stopping SDL Web 8 (a.k.a. Tridion) services
# Inspired by Tridion2011PowerShellProfile.ps1 from Nuno Mendes (nmendes@sdl.com) and Daniel Iyoyo
# Modified by Guus Beltman
# Change Date: 22/7/2016
# Product Scope: SDL Web 8
#
# Installation instructions:
# Open PowerShell and execute the following commands:
@Guzzter
Guzzter / Tridion_profile.ps1
Created March 25, 2016 11:28
My own version of the Powershell profile for managing Tridion 2011/2013
######################################################################################
# Tridion2011PowerShellProfile.ps1
# Originally created by Nuno Mendes (nmendes@sdl.com) and Daniel Iyoyo
# Modified by Guus Beltman
# Change Date: 19/12/2015
# Product Scope: SDL Tridion 2011 and 2013 (all versions)
######################################################################################
######################################################################################
# Installation instructions:
@Guzzter
Guzzter / TridionUtilityFunctions.ps1
Created March 25, 2016 11:21
Some Powershell functions for usage in Tridion machines
# Check if script is run with Administrator permissions. If not: stop directly.
If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(`
[Security.Principal.WindowsBuiltInRole] "Administrator"))
{
Write-Warning "You do not have Administrator rights to run this script!`nPlease re-run this script as an Administrator!"
Break
}
function ExtractZipsAndInstall {
@Guzzter
Guzzter / EnumHelper.cs
Created December 8, 2015 14:07
Enum helper class to convert a string to enum
public static class EnumHelper<T>
{
public static T Parse(string value)
{
return EnumHelper<T>.Parse(value, true);
}
public static T Parse(string value, bool ignoreCase)
{
return (T)Enum.Parse(typeof(T), value, ignoreCase);
@Guzzter
Guzzter / ReplaceRecursive.ps1
Created September 3, 2015 14:00
Recursively replace text in config files
$configFiles=get-childitem . config.xml -rec
foreach ($file in $configFiles)
{
Write-Host "Processing file" $file.FullName
(Get-Content $file.PSPath) | Foreach-Object {$_ -replace "MaxSize=""10000000""", "MaxSize=""20000000"""} | Set-Content $file.PSPath
}
@Guzzter
Guzzter / testurls.sh
Created September 3, 2015 13:59
Bash script to test url and log the http response codes
#!/bin/sh
input=list.txt
output=urls_result.txt
siteprefix=https://www.site.com
rm -rf $output
while read LINE
do