Skip to content

Instantly share code, notes, and snippets.

@omniomi
omniomi / HiDiveSubtitleFix
Created October 23, 2024 03:09
Unminified subtitle fix for HiDive
let styleElement = document.getElementById('ds-vtt-styles');
if (styleElement) {
let vttStyles = styleElement.sheet;
for (let i = 0; i < vttStyles.cssRules.length; i++) {
let rule = vttStyles.cssRules[i];
if (rule.style && rule.style.getPropertyValue('color') === 'yellow' && rule.style.getPropertyPriority('color') === 'important') {
vttStyles.deleteRule(i);
break;
}
}
@omniomi
omniomi / FixHiDiveSubtitles
Created October 23, 2024 03:02
Bookmarklet code to fix subtitles on Hidive
javascript:(function(){let%20styleElement=document.getElementById("ds-vtt-styles");if(styleElement){let%20e=styleElement.sheet;for(let%20t=0;t<e.cssRules.length;t++){let%20l=e.cssRules[t];if(l.style&&"yellow"===l.style.getPropertyValue("color")&&"important"===l.style.getPropertyPriority("color")){e.deleteRule(t);break}}}const%20sheet=new%20CSSStyleSheet,style="\n%20%20%20%20.doris-vtt-style-0%20.ds-text-track__wrapper%20{\n%20%20%20%20%20%20color:%20white!important;\n%20%20%20%20%20%20text-shadow:%20rgba(0,%200,%200,%200.5)%201.95px%201.95px%202.6px!important;\n%20%20%20%20}\n%20%20%20%20.ds-text-track__wrapper-container:nth-of-type(1)%20{\n%20%20%20%20%20%20padding-top:%20120px;\n%20%20%20%20}\t\n%20%20%20%20.ds-text-track__wrapper-container%20{\n%20%20%20%20%20%20padding-top:%20100px;\n%20%20%20%20}\n%20%20%20%20";sheet.replaceSync(style),document.adoptedStyleSheets.push(sheet);})();
/*
* Open vivaldi://experiments
* Enable "Allow for using CSS modifications"
* Open Appearance section in Settings
* Choose the folder you want to use
* In that folder create a "custom.css" file and paste this whole thing there
*
* Browser Settings:
* Themes -> Editor
* Colors
<#PSScriptInfo
.VERSION 1.0.0
.GUID eb246b19-17da-4392-8c89-7c280f69ad0e
.AUTHOR omniomi
.COPYRIGHT Copyright 2018 omniomi. All rights reserved.
.TAGS ActiveDirectory,Password,Expiration,Notification
.EXTERNALMODULEDEPENDENCIES ActiveDirectory
.DESCRIPTION
Send password notification emails to users in Active Directory.
#>
@omniomi
omniomi / app.ino
Created September 17, 2018 16:52
app.ino
#include <LittleRobotFriends.h>
void setup() {
lrf.setup(); // Set up LRF
lrf.setBoredomTimer(0); // Disable boredom mode
lrf.disableEventExpressions(); // Disable default overall behaviour
lrf.disableEvents(); // Disable all events
lrf_expressions_setExpressiveEyeState(LRFExpressiveEyesState_Off);
// Set initial eye state
# Needs a Powerline Font (ie, DejaVu Sans Mono for Powerline).
# Needs Posh-Git module.
Import-Module Posh-Git
$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
if ($currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { $Script:IsAdmin = $true }
function prompt {
if (((Get-Item $pwd).parent.parent.name)) {
@omniomi
omniomi / powershell.tmLanguage.json
Last active May 9, 2018 13:31
powershell.tmLanguage.json
{
"information_for_contributors": [
"This file has been converted from source and may not be in line with the official build.",
"The current master branch for this syntax can be found here: https://github.com/PowerShell/EditorSyntax",
"If you want to provide a fix or improvement, please create a pull request against the original repository."
],
"version": "90549950e769f20df1d1996c5b60cf0d896bee93",
"name": "PowerShell",
"scopeName": "source.powershell",
"patterns": [
@omniomi
omniomi / MeasureLists.ps1
Created April 23, 2018 16:41
Array performance test
Measure-Command -Expression {
$Array = @()
foreach ($i in (1..10000)) {
$Array += $i
}
} | Select @{n='Test';e={ 'Fixed Size' }},TotalMilliseconds
Measure-Command -Expression {
$ArrayForEach = @(foreach ($i in (1..10000)) {
$i
@omniomi
omniomi / Add-DirectoryContextItem.ps1
Last active September 21, 2022 16:54
PowerShell Function - Add-DirectoryContextItem to add right-click context items to Windows Explorer
<#
.Synopsis
Add right-click context items to directories in Explorer
.DESCRIPTION
Adds right-click contextual menu items to directories in Windows Explorer. Example: "Open PowerShell Here"
When run as Administrator the item is added for all users, when run without elevation the option is added for the current user only.
.EXAMPLE