Skip to content

Instantly share code, notes, and snippets.

View Arlodotexe's full-sized avatar

Arlo Arlodotexe

View GitHub Profile
@Arlodotexe
Arlodotexe / index.js
Last active July 8, 2018 06:02
Check a folder for changed files in NodeJS
// Run at least once. Directory is the directory to check, Datapath should point to a json file with an empty array (`[]`) where Node can store file data
function checkForChangedFiles(directory, datapath) {
return new Promise(resolve => {
let filedata = require(datapath);
let changedfiles = [];
fs.readdir(directory, async (err, files) => {
if (err) throw new Error('Unabled to check for existing files. Reason: readdir failed. \n' + err);
for (let i in files) {
if ((function() {
<Page.Resources>
<Style TargetType="mux:NavigationViewItem">
<Setter Property="Foreground" Value="{ThemeResource NavigationViewItemForeground}"/>
<Setter Property="Background" Value="{ThemeResource NavigationViewItemBackground}"/>
<Setter Property="BorderBrush" Value="{ThemeResource NavigationViewItemBorderBrush}"/>
<Setter Property="BorderThickness" Value="{StaticResource NavigationViewItemBorderThickness}"/>
<Setter Property="UseSystemFocusVisuals" Value="True"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="Template">
<Setter.Value>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace AppName
{
public class InstanceContainer
{
public InstanceContainer(WeakReference<object> instance)
@Arlodotexe
Arlodotexe / unflatten-namespaces.ps1
Last active September 13, 2022 11:03
PowerShell script to unflatten and nest the namespaces in a standard DocFx toc.yaml
#####################################
# About
#####################################
# This is a PowerShell port of Aaron Bernstein's NodeJS code by Arlo Godfrey.
# Unflattens and nests the namespaces in a standard DocFx toc.yaml
# Source: https://github.com/dotnet/docfx/issues/274#issuecomment-456168196
# Last updated 5/14/2022.
# Licensed under MIT.
#####################################