Skip to content

Instantly share code, notes, and snippets.

Avatar

Geoff Appleford geoffappleford

  • Nottingham Road, South Africa
View GitHub Profile
@geoffappleford
geoffappleford / Insert external worksheets (1).EXCEL.yaml
Created Mar 9, 2020
Inserts worksheets from another workbook into the current workbook.
View Insert external worksheets (1).EXCEL.yaml
name: Insert external worksheets (1)
description: Inserts worksheets from another workbook into the current workbook.
host: EXCEL
api_set: {}
script:
content: |
$("#file").change(() => tryCatch(insertSheets));
$("#go").click(() => $("#file").click());
async function insertSheets() {
@geoffappleford
geoffappleford / Program.cs
Created Aug 14, 2018 — forked from anurse/CommandLineException.cs
Easy way to debug command-line apps
View Program.cs
private static int Main(string[] args)
{
#if DEBUG
if (args.Any(a => a == "--debug"))
{
args = args.Where(a => a != "--debug").ToArray();
Console.WriteLine($"Ready for debugger to attach. Process ID: {Process.GetCurrentProcess().Id}.");
Console.WriteLine("Press ENTER to continue.");
Console.ReadLine();
}
View gist:949f123b18d3358b07be1626ffce3a3b
var allowPaste = function(e){
e.stopImmediatePropagation();
return true;
};
document.addEventListener('paste', allowPaste, true);
View win10-bash-go-install.sh
#!/bin/bash
set -e
GVERSION="1.8"
GFILE="go$GVERSION.linux-amd64.tar.gz"
GOPATH="$HOME/go"
GOROOT="/usr/local/go"
if [ -d $GOROOT ]; then
echo "Installation directories already exist $GOROOT"
View setup-new-pc.cmd
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
choco install 7zip /y
choco install adobereader /y
choco install arduino /y
choco install azure-cli /y
choco install chocolatey /y
choco install chocolatey-core.extension /y
choco install docker-for-windows /y
choco install firefox /y
View BoxStarter1.txt
Install-WindowsUpdate -AcceptEula
Update-ExecutionPolicy Unrestricted -Force
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Enable-RemoteDesktop
if (Test-PendingReboot) { Invoke-Reboot }
# Update Windows and reboot if necessary
Install-WindowsUpdate -AcceptEula
if (Test-PendingReboot) { Invoke-Reboot }
@geoffappleford
geoffappleford / gist:6087882
Created Jul 26, 2013
Fix for RazorGenerator custom tool not running in VS 2012
View gist:6087882
void Main()
{
var extFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), @"AppData\Local\Microsoft\VisualStudio\11.0\Extensions");
var source = Path.GetDirectoryName(Directory.GetFiles(extFolder, "*.dll", SearchOption.AllDirectories).FirstOrDefault(f => f.EndsWith("RazorGenerator.dll")));
var assemblyBaseFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), @"AppData\Local\assembly\dl3");
var assemblyFolders = Directory.GetFiles(assemblyBaseFolder, "*.dll", SearchOption.AllDirectories).Where(f => f.Contains("RazorGenerator"))
.Select(c => Path.GetDirectoryName(c));
foreach (var target in assemblyFolders){