Skip to content

Instantly share code, notes, and snippets.

View 1RedOne's full-sized avatar

Stephen Owen 1RedOne

View GitHub Profile
@1RedOne
1RedOne / Lottery.Md
Last active May 9, 2024 16:49
Why you don't want to win the lottery
@1RedOne
1RedOne / Readme.md
Created May 1, 2024 19:18
Mining Safety

Surviving in mines


Resources

Interesting stuff - 56 The ways out of the mine should already be clearly marked to meet the requirements of regulation 3 of The Mines (Safety of Exit) Regulations 1988.

@1RedOne
1RedOne / game.js
Created November 9, 2023 15:37
Basic Ball Bouncing on Grid example in phaser 3
function preload() {
this.load.image('ball', 'bullet.png');
this.load.image('tile', 'turret.jpeg');
}
function addBall(physics, tilesGroup, x, y, color) {
var ball1 = physics.add.sprite(x, y, 'ball');
ball1
.setScale(0.1)
.setBounce(1)
@1RedOne
1RedOne / DataGridsAreFun.ps1
Created September 20, 2018 03:03
WPF Example of using and populating a DataGrid with objects in PowerShell
#Sample for this question on SO https://stackoverflow.com/questions/52405852/link-wpf-xaml-to-datagrid-in-powershell?sem=2
$inputXML = @"
<Window x:Class="WpfApp2.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp2"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
@1RedOne
1RedOne / Join-VideoDirectory.ps1
Created October 29, 2018 17:41
Join Video Files with FFMPEG and PowerShell
Function Join-VideoDirectory {
$fileArray = New-Object System.Collections.ArrayList
$items = Get-childitem *.mkv,*.vob,*.mp4,*.ts
$itemCount = $items.Count
$i = 0
$cmdScript = ""
ForEach ($item in $items){
$i++
$cmdScript += "ffmpeg -i `"$($item.Name)`" -f mpegts -c copy file-0$i.mpeg.ts`n"
@1RedOne
1RedOne / Get-OfficeFileInfo.ps1
Created July 21, 2021 15:48
Get Office File Info In PowerShell
#https://stackoverflow.com/questions/34336486/get-file-last-saved-by-property-without-changing-it
function Get-OfficeFileInfo($filePath){
if ($filePath -like "*.doc*"){
Get-WordFileInfo $filePath
}
else{
Get-ExcelFileInfo $filePath
}
}
@1RedOne
1RedOne / setIcon.sh
Created March 3, 2023 15:49
Good work around to have Windows style Profile icons for the Edge Browser
# prereq, install Edge and ALSO Edge Dev
# in Edge, sign in with your normal profile
# in Edge Dev, sign in with your work profile
# then download the thumbnail / profile icon you want for both
# finally, install fileIcon
#to run as a cronJob (like a Windows scheduled task)
# run 'sudo crontab -e'
# add this line to the top
# 45 * * * * /Library/temp/setIcons.sh >> /Users/Stephen/iconSetLog.log
@1RedOne
1RedOne / CreateVm.cs
Created January 18, 2023 14:28
Azure.ResourceManager Create VM with new nic example.cs
using Azure;
using Azure.Core;
using Azure.ResourceManager;
using Azure.ResourceManager.Compute;
using Azure.ResourceManager.Compute.Models;
using Azure.ResourceManager.Network;
using Azure.ResourceManager.Network.Models;
using Azure.ResourceManager.Resources;
namespace AutoManageTest
scary, fear, fnaf, freddies, huggy wuggy, cursed thomas, choo choo charles, darwin awards, Trollface Quest: Horror, FNaF: Sister Location Custom Night, MOMO, Escape from Ayuwoki, The Secret of the Necromancer, Five Nights at Freddy's, Slenderman Must Die: Silent Streets,jumpscare
@1RedOne
1RedOne / DownloadEmAll.ps1
Created August 29, 2016 16:11
Download all files from a site in powerShell.ps1
<#
found this site which has all of the soundtrack to MH4 for free
BUT, you can't click downlaod and save each one, instead each link takes you to a new page with it's own DL link embedded within the site
Solution?
Wou write a short powershell script to find all the links we want, then load each page, find any downloadable MP3 links within that page and save them all
#>
$u = 'http://downloads.khinsider.com/game-soundtracks/album/monster-hunter-4'