Skip to content

Instantly share code, notes, and snippets.

View SeidChr's full-sized avatar

Christian Seidlitz SeidChr

View GitHub Profile
@SeidChr
SeidChr / export-netflix-rating.js
Last active June 11, 2023 22:19
Script can export netflix thumbs-ratings as json when pasted in a browser console on the https://www.netflix.com/viewingactivity tab.
console.log(JSON.stringify(Array.from(document.querySelectorAll('.retableRow')).map(node => {
let rating
const up1 = node.querySelectorAll('[data-name="RateUpFill"]')
const up2 = node.querySelectorAll('[data-name="RateTwoThumbsFill"]')
// const down = node.querySelectorAll('[data-name="RateDownFill"]')
if (up1.length) {
rating = 1
} else {
if (up2.length) {
@SeidChr
SeidChr / Hey-Gpt.ps1
Last active March 2, 2023 01:05
Proof of concept for a Powershell Ai ChatBot .. or just an api client. whatever you want to call it :)
# make sure to set your own $apiKey beforehand.
function Hey-Gpt {
param([string] $Message, [switch]$Reset)
if ($Reset -or (-not $global:OpenAiChatMessages)) {
$global:OpenAiChatMessages = [System.Collections.ArrayList]::new()
}
$null = $global:OpenAiChatMessages.Add(@{ "role" = "user"; "content" = $message})
$conversation = @{ "model"="gpt-3.5-turbo"; "messages" = $global:OpenAiChatMessages }
@SeidChr
SeidChr / SystemRandomWakeupIssues.ipynb
Last active January 19, 2023 11:14
System Random Wakeup Issues
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@SeidChr
SeidChr / UnitTest1.cs
Created December 11, 2022 02:07
Playwright with XUnit
namespace playwrighttests;
// <PackageReference Include="PlaywrightSharp" Version="0.192.0" />
public class UnitTest1
{
[Fact]
public async void Test1()
{
var pw = await PlaywrightSharp.Playwright.CreateAsync();
var br = await pw.Chromium.LaunchAsync();
@SeidChr
SeidChr / .editorconfig
Last active March 16, 2024 17:26
well defined editorconfig for all c# projects
################################################
## ##
## READ FIRST ##
## ##
################################################
# You can find the source of this document here:
# https://gist.github.com/SeidChr/60c54944920f3f5c47c4b2b79a552023
# To learn more about .editorconfig see https://aka.ms/editorconfigdocs
# https://www.mobile.de/svc/my/parking-list/?lang=de
Get-Clipboard | ConvertFrom-Json |% items |? status -eq OK |% {
$now = Get-Date
$kmIndex = 1000000
$priceIndex = 700000
$ageIndex = 100
$kmAIndex = 300000
} {
$month,$year = $_.ad.attr.fr?.split("/") ?? 0,0
filter To-Select {
$object = $_
$type = $_.GetType()
if ($type -in [hashtable],[pscustomobject]) {
$properties = ([pscustomobject] $_).psobject.properties
$propNames = $properties.name
if (-not ("Name" -in $propNames -and "Expression" -in $propNames)) {
$object = $properties | ForEach-Object {
@{
Name = $_.name
# generate regex match groups from arrays
function ContGroup {
param([object[]]$Source, [int]$GroupSize)
0..($Source.Length-$GroupSize) |% { $Source | Select -Skip $_ -First $GroupSize | Join-String }
}
# $ ContGroup -Source (1..9 + 0) -GroupSize 4 | Join-String -Separator '|'
# 1234|2345|3456|4567|5678|6789|7890
# $ ContGroup -Source ('a'..'z') -GroupSize 3 | Join-String -Separator '|'
# abc|bcd|cde|def|efg|fgh|ghi|hij|ijk|jkl|klm|lmn|mno|nop|opq|pqr|qrs|rst|stu|tuv|uvw|vwx|wxy|xyz
@SeidChr
SeidChr / ExtractRVIndex.ps1
Created October 3, 2022 16:43
Extracts information about parked cars from mobile.de and calculates an index (higher is better) based on milage, age and price
# https://www.mobile.de/svc/my/parking-list/?lang=de
$j | ConvertFrom-Json |% items |? status -eq OK |% {
$now = Get-Date
$kmIndex = 1000000
$priceIndex = 700000
$ageIndex = 100
$kmAIndex = 300000
} {
$month,$year = $_.ad.attr.fr?.split("/") ?? 0,0
$km = [int][Regex]::Replace($_.ad.attr.ml, "[^\d]", '')
@SeidChr
SeidChr / FunnyWords.txt
Created May 19, 2022 19:08
Funny Words
Schmutzbug // 20220519 Eifelkanal Discord