Skip to content

Instantly share code, notes, and snippets.

View zleight1's full-sized avatar
🕶️
Coding

Zachary Leighton zleight1

🕶️
Coding
View GitHub Profile
@zleight1
zleight1 / FixRFP.sh
Last active August 29, 2015 14:16
How To Fix RouteFinder Pro
cd /home/
rm -rf DevelopmentSVN
git init --bare routefinder
echo 'Problem Solved!'
@zleight1
zleight1 / DivExample.html
Created May 14, 2015 18:28
Floating Example
<html>
<head>
<style>
.red {
background-color: red;
}
.blue {
background-color: blue;
}
div {
@zleight1
zleight1 / MoqDataExtensions.cs
Created January 11, 2016 16:31 — forked from jwatney/MoqDataExtensions
Moq extensions for mocking ADO.NET interfaces.
using System;
using System.Collections;
using System.Data;
using Moq;
namespace Moq.DataExtensions {
public static class MockFactoryDataExtensions {
public static Mock<IDbCommand> CreateIDbCommand(this MockFactory factory) {
var command = factory.Create<IDbCommand>();
@zleight1
zleight1 / check-versions.js
Created May 17, 2018 11:40
A check version script
const semver = require('semver');
const chalk = require('chalk');
const packageConfig = require('./package.json');
const exec = function (cmd) {
return require('child_process')
.execSync(cmd).toString().trim();
};
const versionRequirements = [
{
@zleight1
zleight1 / fix-package-lock.js
Created September 3, 2019 17:19
Package-lock.json Node fix file
'use strict';
const fs = require('fs');
const packageLockFile = 'package-lock.json';
fs.readFile(packageLockFile, 'utf8', (err, data) => {
if (err) {
return console.log(err);
}
@zleight1
zleight1 / web-server.tcl
Created January 19, 2021 07:57
36 line web server in TCL
array set env {PORT 8080 ROOT public_html DEFAULT index.html ME localhost:8080}
foreach t {image:png,gif,jpg=jpeg text:htm=html,txt=plain,css :pl=php=tcl=cgi} {
foreach el [lrange [split $t :,] 1 end] {
foreach ext [split $el =] {regsub {:.*=} $t=$el / mime(.$ext)}
}
}
set match {(GET|POST) (/[^ ?]*)\??(\S*).*?\n(.*?)\n\n(.*)}
proc answer {sock from p2} {fileevent $sock readable [list serve $sock $from]}
proc serve {sock from} {
fconfigure $sock -blocking 0
@zleight1
zleight1 / fix-windows-build-tools.ps1
Last active February 10, 2021 20:51
Script to download and fix npm windows-build-tools C++ deps
$TempDir = "C:\temp\windows-build-tools"
If(!(test-path $TempDir))
{
New-Item -ItemType Directory -Force -Path $TempDir
}
$client = new-object System.Net.WebClient;
$client.DownloadFile("https://aka.ms/vs/16/release/vs_buildtools.exe","$TempDir\vs_buildtools.exe");
cd "$TempDir";
.\vs_buildtools.exe --passive --wait --norestart --nocache --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --locale en-US --noUpdateInstaller | Out-Null;
@zleight1
zleight1 / azp-custom-schema.yml
Last active July 1, 2021 22:03
AZP VS Code Extension Custom Schema With Template Syntax
This file has been truncated, but you can view the full file.
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://github.com/Microsoft/azure-pipelines-vscode/blob/master/local-schema.json",
"$comment": "v1.147.0",
"title": "Pipeline schema",
"description": "A pipeline definition",
"oneOf": [{
"$ref": "#/definitions/pipeline"
}, {
"type": "string",
@zleight1
zleight1 / root-config.js
Created October 12, 2022 08:24
single-spa root config trying for on-demand bundle loading
import {
constructRoutes,
constructApplications,
constructLayoutEngine,
} from "single-spa-layout";
import { registerApplication, start } from "single-spa";
const routes = constructRoutes(document.querySelector("#single-spa-layout"), {
loaders: {
topNav: "<h1>Loading topnav</h1>",