Skip to content

Instantly share code, notes, and snippets.

Avatar

Adam Plocher aplocher

View GitHub Profile
View resume.json
{
"basics": {
"name": "Adam Plocher",
"picture": "https://avatars0.githubusercontent.com/u/1132447?v=4",
"label": "Software Developer at Varis LLC",
"headline": "A motivated and professional software engineer with over 15 years of experience in the industry",
"summary": "Experienced full-stack developer with an appreciation for design patterns.",
"website": "http://blog.bitcollectors.com/adam",
"yearsOfExperience": 19,
"username": "aplocher",
@aplocher
aplocher / CmderHere.bat
Created Jan 14, 2020
Small bat file that will prompt for Cmder's root dir. It will set the CMDER_ROOT env variable and register "Cmder Here" context menu entries in Windows Explorer.
View CmderHere.bat
@echo off
net file > NUL 2>&1
if not [%ERRORLEVEL%]==[0] (
echo ERROR - RUN AS ADMIN
echo.
goto :done
)
echo Enter the path to the CMDER folder...
@aplocher
aplocher / Program.cs
Created May 30, 2019
A simple C# function (and console app) to flatten an array down to a specified generic type
View Program.cs
using System;
using System.Collections.Generic;
namespace ConsoleApp3
{
// This is a sample Console App written in C# / .NET Core (but should work with .NET Framework).
// This will flatten an array structure, recursively, down to the generic type specified (or throw an exception if the input is bad)
class Program
{
@aplocher
aplocher / simplify3d_ending_script.gcode
Created Sep 2, 2018
Simplify 3D G-Code starting script to reduce temp (to reduce oozing), perform homing, auto-leveling, return the temp to the target, and then clean nozzle. Stop script will turn off extruder, bed, move Z up a little bit, move X slightly (so if oozing occurs, hopefully not on the final printed piece), and move Y forward, then turn the fan off afte…
View simplify3d_ending_script.gcode
M104 S0 ; turn off extruder
M140 S0 ; turn off bed
G91 ; relative movement
G1 F150 ; slow Z rate
G1 Z10 ; Z up 15mm
G1 X3 ; X 3mm
G1 Y3 ; Y 3mm
G90 ; back to absolute movement
G1 Y200 F1000
M84 ; disable motors
View BackupScriptForTony.bat
@echo off
setlocal
:: <config>
:: CONFIGURATION STUFF BELOW
:: Base folder where the new sub-folders will be created. Do NOT include a trailing slash [eg, c:\temp is ok, but not c:\temp\]
set "baseDir=C:\TEMPOUTPUT"
:: The second destination to recieve a copy of these files
set "baseDir2=C:\TEMPOUTPUT2"
@aplocher
aplocher / clapper.py
Last active Mar 17, 2017
Python script to detect signal from MAX4466 Mic Amp and send an RF signal to power on/off a plug when it detects two clap sounds (aka "DIY The Clapper"). Implemented on Raspberry Pi Zero
View clapper.py
#!/usr/bin/python
#
# usage: clapper.py [-h] [--on | --off]
#
# With no arguments, this will run continuously and listen for clap noises to
# trigger an RF power plug to turn on or off (aka The Clapper). Can
# alternatively be used to manually control a power plug with arguments
#
# optional arguments:
# -h, --help show this help message and exit
@aplocher
aplocher / setup_mssql.ps1
Created Jan 21, 2017 — forked from DamianZaremba/setup_mssql.ps1
MSSQL Server Setup - designed to be run via ssh, ie vagrant under opentable/win-2012r2-standard-amd64-nocm
View setup_mssql.ps1
$ErrorActionPreference = "Stop"
$client = new-object System.Net.WebClient
# Reset vagrant password so it's not expired
([adsi]"WinNT://vagrant-2012-r2/vagrant").SetPassword("P@55w0rd!")
# Setup UAC wrapper ;(
if(!(Test-Path -Path "C:\uacts_x64.zip")) {
Write-Output "Setting up UAC wrapper"
$client.DownloadFile("http://www.itknowledge24.com/files/uacts_x64.zip", "C:\uacts_x64.zip")
@aplocher
aplocher / GStreamer-1.0 some strings.sh
Created Sep 20, 2016 — forked from strezh/GStreamer-1.0 some strings.sh
GStreamer-1.0 personal cheat sheet
View GStreamer-1.0 some strings.sh
#!/bin/bash
# play YUV444 FULL HD file
gst-launch-1.0 -v filesrc location=size_1920x1080.yuv ! \
videoparse width=1920 height=1080 framerate=25/1 format=GST_VIDEO_FORMAT_Y444 ! \
videoconvert ! \
autovideosink
# play YUV422 FULL HD file
gst-launch-1.0 -v filesrc location=size_1920x1080.yuv ! \
@aplocher
aplocher / FixSynaptics.bat
Created May 22, 2016
Since upgrading to Windows 10 the Synaptics driver will occasionally become unstable (specifically when explorer.exe dies) and cause the mouse cursor to lock up for a few seconds every couple of minutes. I've experienced this on my HP Elitebook 8470p and Elitebook 840G2, but it's likely occuring on any laptop with a Synaptics touch pad in Win10.…
View FixSynaptics.bat
@echo off
rem FOR RESETTING SYNAPTICS MOUSE DRIVER
rem HELPFUL FOR WHEN MOUSE REGULARLY FREEZES AFTER EXPLORER.EXE HANGS
rem OR SCROLL/GESTURES STOP WORKING RANDOMLY
taskkill -f -im syntpenh.exe
pushd C:\Program Files\Synaptics\SynTP
start "" "syntpenh.exe"
popd
timeout /t 2 /nobreak >nul
exit /b
@aplocher
aplocher / FixStoreApps.ps1
Last active Nov 19, 2020
Fix for Remove-AppxPackage error "HRESULT: 0x80073CFA, Removal failed The system cannot find the file specified.". Requires psexec to be installed
View FixStoreApps.ps1
param (
[switch]$Relaunched = $false
)
$ScriptPath = (Get-Variable MyInvocation).Value.MyCommand.Path
function StartOperation {
Write-Host
Write-Host Now attempting to regenerate missing manifest files...
Write-Host
You can’t perform that action at this time.