Skip to content

Instantly share code, notes, and snippets.

Stephen Owen 1RedOne

Block or report user

Report or block 1RedOne

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@1RedOne
1RedOne / Fix-CmdAutoComplete.ps1
Created Sep 14, 2019
Fix Tab Autocomplete for Cmd
View Fix-CmdAutoComplete.ps1
#In the new update to Windows 10, the tab autocomplete character was changed to CTRL+D or CTRL+F
#Run PowerShell in an elevated mode to change it back to 'Tab'
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Command Processor\' -Name PathCompletionChar -Value 9
@1RedOne
1RedOne / Kindle.md
Last active Aug 30, 2019
Kindle Feature Suggestions
View Kindle.md

Kindle Suggestions

We bought a pair of Kindles Fire HD 8 tablets for the kids to use as a learning device. We were particularly motivated by Amazon Rapids, which my daughter loves and really has helped her reading ability. (We ever going to get new books? No new Rapids books since April of 2018!)

However my ability to control their experience wihtin the Kindle's primary usage environment, FreeTime, is way too limited for what I want. Here is how I'd like to see FreeTime ammended.

Give me Categorical Control Options

Today, there is simply way too much available in FreeTime. There are games, Movies, Videos, and way too much.

@1RedOne
1RedOne / Foodtrucks.ps1
Last active Mar 3, 2019
Parsing out foodtruck times with PowerShell and REST
View Foodtrucks.ps1
$FoodTruckEvents = Invoke-RestMethod https://www.seattlefoodtruck.com/api/events?page=1&for_locations=51&with_active_trucks=true&include_bookings=true&with_booking_status=approved'
#this endpoint gives us a JSON response with multiple events, so we parse out each event
ForEach ($event in $FoodTruckEvents.events){
#each event seems to be one day, so we resolve the .start_time and make it human readable
$date = Get-Date $event.start_time | Select-Object -ExpandProperty DateTime
#each event could have more than one truck, so we step through them
ForEach ($booking in $event.bookings){
@1RedOne
1RedOne / Readme.md
Last active Jan 17, 2019
Backup of post from reddit
View Readme.md

tribalism

Sure, but if you want to be objective about it you can't deny that one side is more tribal then the other.

@1RedOne
1RedOne / Example.md
Last active Apr 29, 2019
Extracting content from an API from a site
View Example.md

Extracting Content from a site's unpublished API

Imagine that youve found a site that has a perfect list of some info you need, but the site owner's don't have it in a format you can easily use! This happens a lot, but fortunatley for us, if the data can be retrieved and displayed in a web browser, we can normally request that same data directly through a web call instead!

The problem is that the API endpoints we need to hit may not always be published publically.

For instance, this webpage has a lot of good info on beer, but no great way to export it.

https://www.systembolaget.se/sok-dryck/?subcategory=%C3%96l&type=Ale%20brittisk-amerikansk%20stil&style=Imperial%2FDubbel%20IPA&fullassortment=1

@1RedOne
1RedOne / Resolve-UniqueKBRecords.ps1
Created Nov 7, 2018
Search for matching records in a big csv using the .Where Method for speed
View Resolve-UniqueKBRecords.ps1
$csv = ConvertFrom-CSV "ComputerName,KBNeeded
Server01,KB1234567
Server02,KB1234567
Server03,KB1234567
Server04,KB1234567
Server05,KB1234567
Server01,KB3456789
Server01,KB5678910"
$uniquePCs = $csv | Group-Object -Property ComputerName | Select -ExpandProperty Name
@1RedOne
1RedOne / Join-VideoDirectory.ps1
Created Oct 29, 2018
Join Video Files with FFMPEG and PowerShell
View Join-VideoDirectory.ps1
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 / Lottery.Md
Last active Oct 19, 2018
Why you don't want to win the lottery
View Lottery.Md
@1RedOne
1RedOne / DataGridsAreFun.ps1
Created Sep 20, 2018
WPF Example of using and populating a DataGrid with objects in PowerShell
View DataGridsAreFun.ps1
#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 / ReadMe.md
Last active Aug 16, 2018
Parsing Malformed HTML via SQL
View ReadMe.md

First off the source HTML has a lot of issues, as we can see here:

'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<STYLE type=text/css> P, UL, OL, DL, DIR, MENU, PRE { margin: 0 auto;}</STYLE>
<META name=GENERATOR content="MSHTML 11.00.10586.35"></HEAD>

<BODY leftMargin=1 topMargin=1 rightMargin=1>
You can’t perform that action at this time.