Skip to content

Instantly share code, notes, and snippets.

View oechsler's full-sized avatar

Samuel Oechsler oechsler

View GitHub Profile
@oechsler
oechsler / filter.tsx
Last active November 27, 2021 10:54
React component for filtering sets of components
import { FC, ReactNode } from "react";
import { filter as childrenFilter } from "react-children-utilities";
export const filter = (
children: ReactNode,
filters: ReactNode[],
exclude: boolean = false,
): ReactNode[] => {
return childrenFilter(children, (child: any) => {
const childTypeName = child.type?.name ?? child.type;
@oechsler
oechsler / office365monthly.bat
Created February 20, 2019 22:01
Switch from semi-anual to monthly updates in Office 365 Business
setlocal
reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\Configuration\ /v CDNBaseUrl
if %errorlevel%==0 (goto SwitchChannel) else (goto End)
:SwitchChannel
reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\Configuration /v CDNBaseUrl /t REG_SZ /d "http://officecdn.microsoft.com/pr/492350f6-3a01-4f97-b9c0-c7c6ddf67d60" /f
reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\Configuration /v UpdateUrl /f
reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\Configuration /v UpdateToVersion /f
reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\Updates /v UpdateToVersion /f
reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Office\16.0\Common\OfficeUpdate\ /f
:End
@oechsler
oechsler / web.config
Last active May 4, 2019 12:59
Web.config for React hosted on Azure
<?xml version="1.0"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<!-- Routing for React Router -->
<rule name="React Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
@oechsler
oechsler / install_xrdp_audio.sh
Last active December 12, 2018 22:55
Simple script for installing audio support via xrdp in a Hyper-V machine running Ubuntu
#!/bin/bash
# This Script will install Pulseaudio sound redirection
# for Ubuntu 18.04 running in Microsoft Hyxper-V
# Script based on this tutorial:
# https://bit.ly/2QSumXC
sudo apt install xrdp-pulseaudio-installer -y