Skip to content

Instantly share code, notes, and snippets.

View WillSams's full-sized avatar
🚀

Will Sams WillSams

🚀
View GitHub Profile
@WillSams
WillSams / interview_questions.sh
Last active December 20, 2019 13:34
Powershell Coding Interview
# ==============================================================================
# 1 - Powershell program to determine if any two integers in array sum to given integer
# ==============================================================================
echo '$myArray = @{}
class Algorithm {
#Brute force solution, O(n^2) time complexity
[bool] TwoIntegersSumToTarget([int[]] $arr, [int] $target) {
$numElements = $arr.length
for ([int] $outer = 0; $outer -lt $numElements; $outer++) {
@WillSams
WillSams / debug-legacy-dotnet-in-vscode.sh
Last active April 13, 2020 15:36
Debug Legacy .NET in VS Code on Windows
#!/bin/bash
echo "********************************************************************"
echo
echo " Debug Legacy .NET in VS Code on Windows "
echo " Pre-req: Latest 64-bit MSYS2 from http://www.msys2.org/ "
echo
echo " Howto: Use 'wget' to download the raw version of this script "
echo " and execute the following from the MSys2 command-line: "
echo " chmod +x debug-legacy-dotnet-in-vscode.sh "
@WillSams
WillSams / generate.sh
Last active February 11, 2020 21:04
Simple VS Code C# Solution Generation Example
#!/bin/bash
echo "==============================================================="
echo " This script can be executed under Linux (Debian based) or "
echo " Windows (using MSys2/Git Bash) "
echo " Also, Sqlite3 will be installed if already not availabe. "
echo
echo " To ensure this script works, run this command on this file: "
echo " chmod +x generate.sh "
echo "==============================================================="
@WillSams
WillSams / wiiu_retroarch_notes
Created March 11, 2020 13:06
Fix Retroarch Assets/Scan On Wii U
[Note: Not mine, this was copy word for word from here: https://pastebin.com/raw/6NAUDzgJ]
How to Fix Retroarch Assets and Game Scan
====================================================================================================================================
How to Fix Retroarch on your if the online updater and scanner are not working.
[Example designed for Wii u but should be cross platform if your having a problem]
1. Download Retroarch on your platform of choice. (Retroarch rpx version on wii u)
2. Run Retroarch at least once, if your missing assets it will ask you to use the online updater which on Wii u will fail.
@WillSams
WillSams / branch-delete-for-the-padawan.sh
Last active April 17, 2020 12:26
Deleting a Git Branch
git push origin --delete myfeature # delete remote branch
git branch -d myfeature # delete local branch
#git branch -dr origin/myfeature # delete local remote tracking branch
git fetch origin -p # delete (prune from tree) multiple obsolete tracking branches
@WillSams
WillSams / minidlna-setup.sh
Last active December 10, 2023 20:41
MiniDLNA Setup
SERIALOFINSTANCE=$((100000000000000 + RANDOM % 999999999999999))
sudo bash -c "apt update && apt install minidlna -y"
sudo bash -c "port=8200
friendly_name=Mintbox-Desktop-MiniDLNA
serial='$SERIALOFINSTANCE'
media_dir=A,/media/wsams/mediadrive2/Music
media_dir=V,/media/wsams/mediadrive2/Videos/Movies
@WillSams
WillSams / ufw_plex.md
Created March 31, 2020 12:35 — forked from nmaggioni/ufw_plex.md
Plex Media Server UFW rule

/etc/ufw/applications.d/plexmediaserver

[plexmediaserver]
title=Plex Media Server (Standard)
description=The Plex Media Server
ports=32400/tcp|3005/tcp|5353/udp|8324/tcp|32410:32414/udp

[plexmediaserver-dlna]
title=Plex Media Server (DLNA)
description=The Plex Media Server (additional DLNA capability only)
@WillSams
WillSams / nuget.md
Last active April 19, 2020 13:03
.NET Core Create & Use Local .Nuget Package (/w content)

Hard to find good information on the Interwebs about this. See below on how to do this correctly:

  <PropertyGroup>
    <TargetFramework>netcoreapp2.2</TargetFramework>
    <PackageId>Otter</PackageId>
    <Version>0.9.6-20200417</Version>
    <IncludeAssets>all</IncludeAssets>
  </PropertyGroup>
@WillSams
WillSams / Makefile
Created April 17, 2020 23:21
Sonic 1 Disassembly Makefile
# This is a makefile for Andy Grind's Sonic 1 disassebly fork (https://github.com/andwn/s1disasm)
# and works with the Linux/Windows toolchain creaed from my script:that works with my toolchain.
# Script for my Linux toolchain -> https://gist.github.com/WillSams/c4cbf6235b467d8b595693969342237e
# Script for my Windows toolchain -> https://gist.github.com/WillSams/f592f9d494b51119945440f7e91079b0
GENDEV=/opt/m68k
AS = $(GENDEV)/bin/m68k-elf-as
LD = $(GENDEV)/bin/m68k-elf-ld
Github deleting scripts?
Can't find my original linux-devel-setup.sh. Damn.