Skip to content

Instantly share code, notes, and snippets.

View primaryobjects's full-sized avatar

Kory Becker primaryobjects

View GitHub Profile
@primaryobjects
primaryobjects / readme.md
Created August 14, 2019 19:13
How to preview an RST document in Sublime Text.

How to Preview an RST Document in Sublime Text

  1. In Sublime Text, click Preferences->Package Control.
  2. Type install and press Enter.
  3. Type OmniMarkupPreviewer and press Enter.
  4. After installing, open a .rst file (it must be a file already saved with a .rst file extension).
  5. In Sublime Text, use the hot-key CTRL-ALT-O or click Tools->Command Palette and type preview, selecting Preview Current Markup in Browser.

Your web browser should launch on localhost and display the formatted rst file.

@primaryobjects
primaryobjects / readme.md
Last active April 20, 2024 12:11
How to Configure AutoGPT with Azure OpenAI Active Directory Managed Identity

How to Configure AutoGPT with Azure OpenAI Active Directory Managed Identity

AutoGPT is an extension of ChatGPT to automatically run an agent to complete a solution without human intervention.

Normally, an OpenAI API key is used.

For Azure OpenAI, you must use either an API token or an Azure Active Directory account.

Loading an API Key with Azure Managed Identity

@primaryobjects
primaryobjects / m3u8.md
Last active April 15, 2024 15:19
How to download m3u8 and ts video movie streams.

m3u8 Downloading

  1. Open Chrome Developer tools and click the Network tab.
  2. Navigate to the page with the video and get it to start playing.
  3. Filter the list of files to "m3u8".
  4. Find master.m3u8 or index.m3u8 and click on it.
  5. Save the file to disk and look inside it.
  6. If the file contains a single m3u8 master url, copy that one instead.
  7. Run the program m3u8x.
  8. Paste the same m3u8 url in both textboxes (URL and Quality URL) and click "Headers" and set the referral url and user-agent from the request as found in Chrome.
@primaryobjects
primaryobjects / hotspot-keep-alive.ps1
Last active April 13, 2024 15:53
Script to Enable Windows 10 Mobile Hotspot Automatically After Reboot
# https://superuser.com/a/1434648
Add-Type -AssemblyName System.Runtime.WindowsRuntime
$asTaskGeneric = ([System.WindowsRuntimeSystemExtensions].GetMethods() | ? { $_.Name -eq 'AsTask' -and $_.GetParameters().Count -eq 1 -and $_.GetParameters()[0].ParameterType.Name -eq 'IAsyncOperation`1' })[0]
Function Await($WinRtTask, $ResultType) {
$asTask = $asTaskGeneric.MakeGenericMethod($ResultType)
$netTask = $asTask.Invoke($null, @($WinRtTask))
$netTask.Wait(-1) | Out-Null
$netTask.Result
@primaryobjects
primaryobjects / tplink-archer-t4u.md
Last active April 4, 2024 14:27
Steps to Install the TP-Link Archer T4U Plus AC1300 USB WiFi Adapter on Linux Mint
@primaryobjects
primaryobjects / quiz6.txt
Last active March 28, 2024 10:56
Finance for Non-Finance Professionals Week 5 Final Exam
1.
Question 1
In 5 years you are going to get $2,000.
If interest rates unexpectedly rise, the present value of that future amount to
you would
1 point
### Fall
@primaryobjects
primaryobjects / react-confirm.js
Created November 1, 2017 19:03
A simple example of a confirm alert dialog in ReactJs / React.
<div className='delete-button' onClick={() => { if (window.confirm('Are you sure you wish to delete this item?')) this.onCancel(item) } } />
@primaryobjects
primaryobjects / json2csharp.txt
Last active March 25, 2024 07:14
Neat trick to convert JSON to a C# class in Visual Studio.
1. Copy some JSON to your clipboard. Need some JSON? Here you go http://goo.gl/mWZSEL
2. In Visual Studio, right-click your project and select Add->Class.
3. Highlight the following code in your class:
class Class1
{
}
4. From the top menu, select Edit->Paste Special->Paste JSON as Classes.
5. Rename "Rootobject" to your desired class name. Done!
@primaryobjects
primaryobjects / hotspot-keepalive.bat
Last active March 24, 2024 07:57
Script to Enable Windows 10 Wifi Mobile Hotspot Automatically and Keep Alive on Disconnect
PowerShell -Command "Set-ExecutionPolicy Unrestricted" >> "%TEMP%\StartupLog.txt" 2>&1
PowerShell C:\Users\YOUR_USERNAME\Desktop\hotspot-keepalive.ps1 >> "%TEMP%\StartupLog.txt" 2>&1
@primaryobjects
primaryobjects / ghz.md
Created August 5, 2021 19:16
GHZ quantum circuit in Qiskit.

A GHZ quantum circuit is a quantum computing system that includes 3 entangled qubits.

A Greenberger–Horne–Zeilinger state (GHZ state) is a certain type of entangled quantum state that involves at least three subsystems.

Demo in IBM Quantum Composer.