Skip to content

Instantly share code, notes, and snippets.

View niikoo's full-sized avatar
🐌

Nikolai Ommundsen niikoo

🐌
View GitHub Profile
using System;
using System.Reflection;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace Faktum.Ics.Library.Utilities.Json
{
/// <inheritdoc />
/// <summary>
/// Defaults enum to the default value (first element). Can be overridden by setting an int as default value.
@niikoo
niikoo / skattelisten.clickdrop.user.js
Last active November 16, 2024 11:16
Prevent clicking entries in 'skattelisten'
// ==UserScript==
// @name Prevent clicking search results in "Skattelisten".
// @namespace http://tampermonkey.net/
// @version 0.4.0
// @author niikoo
// @match https://tjenester.skatteetaten.no/personsok
// @match https://skatt.skatteetaten.no/web/skattelistesoek*
// @grant none
// @downloadURL https://gist.github.com/niikoo/5948a7d0a2d1bee2f0cfc1321ee6e7d9/raw/skattelisten.clickdrop.user.js
// @updateURL https://gist.github.com/niikoo/5948a7d0a2d1bee2f0cfc1321ee6e7d9/raw/skattelisten.clickdrop.user.js
// ==UserScript==
// @name Trello fix "Redirecting"
// @namespace http://tampermonkey.net/
// @version 0.1.2
// @description Fix the annoying "Redirecting" box that trello puts up if the url needs auth.
// @author niikoo
// @match https://trello.com/c/*
// @updateURL https://gist.github.com/niikoo/78f4ea602d9e596745dc929aebfec399/raw/trello-description-redirectingBox-fix.user.js
// @downloadURL https://gist.github.com/niikoo/78f4ea602d9e596745dc929aebfec399/raw/trello-description-redirectingBox-fix.user.js
// @icon https://www.google.com/s2/favicons?domain=trello.com
SELECT
fk.name 'Foreign Key Name',
tp.name 'Parent table',
cp.name 'Parent colName',
cp.column_id 'Parent colId',
tr.name 'Refrenced table',
cr.name 'Referenced colName',
cr.column_id 'Referenced colId'
FROM sys.foreign_keys fk
INNER JOIN sys.tables tp ON fk.parent_object_id = tp.object_id
// ==UserScript==
// @name SAS EuroBonus Online Shopping - Sort by points descending
// @namespace http://tampermonkey.net/
// @version 0.1.3
// @description Sorting the points
// @author niikoo
// @match https://onlineshopping.flysas.com/*
// @icon https://icons.duckduckgo.com/ip2/flysas.com.ico
// @updateURL https://gist.github.com/niikoo/0a86f8cd0b71c971f2284f04cf75a3f2/raw/sas-eurobonus-online-shopping-pointsort.user.js
// @downloadURL https://gist.github.com/niikoo/0a86f8cd0b71c971f2284f04cf75a3f2/raw/sas-eurobonus-online-shopping-pointsort.user.js
@niikoo
niikoo / enable-explorer.exe-script-previews.cmd
Last active June 27, 2021 10:49
Windows 10 Improve explorer.exe Previews
REM Run this file as Administrator
REM Python
reg add HKLM\SOFTWARE\Classes\.py /v PerceivedType /t REG_SZ /d text /f
REM Lua
reg add HKLM\SOFTWARE\Classes\.lua /v PerceivedType /t REG_SZ /d text /f
REM node.js/npm
reg add HKLM\SOFTWARE\Classes\.npmignore /v PerceivedType /t REG_SZ /d text /f
@niikoo
niikoo / ffmpeg-mp4-to-animated-webp.md
Created July 5, 2021 19:21 — forked from witmin/ffmpeg-mp4-to-animated-webp.md
Convert MP4 file to animated WebP in ffmpeg

Convert MP4 file to animated WEBP file in ffmpeg CLI

1. Install ffmpeg CLI through homebrew

In terminal.app, install ffmpeg through homebrew

brew install ffmpeg

Validate the installation:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\Setup\LabConfig]
"BypassTPMCheck"=dword:00000001
"BypassSecureBootCheck"=dword:00000001
@niikoo
niikoo / webvtt-decoder.cyber.chef
Created July 16, 2021 14:03
WEBVTT Decoder 1.1
Find_/_Replace({'option':'Simple string','string':'WEBVTT'},'',true,false,false,false)
Find_/_Replace({'option':'Regex','string':'([0-9]{2}\\:[0-9]{2}(\\:[0-9]{2}){0,1}\\.[0-9]{3}\\s\\-\\-\\>\\s[0-9]{2}\\:[0-9]{2}(\\:[0-9]{2}){0,1}\\.[0-9]{3,4})'},'',true,false,false,false)
Regular_expression('User defined','^(.{0,})?(?![0-9]{2}\\:[0-9]{2}\\:[0-9]{2}\\.[0-9]{3}\\s\\-\\-\\>\\s[0-9]{2}\\:[0-9]{2}\\:[0-9]{2}\\.[0-9]{3}){1(.{0,}?)$',true,true,true,false,false,false,'List capture groups'/disabled)
Find_/_Replace({'option':'Extended (\\n, \\t, \\x...)','string':'\\n\\n\\n'},'\\n\\n',true,false,true,false)
Find_/_Replace({'option':'Extended (\\n, \\t, \\x...)','string':'\\n\\n'},'\\n',true,false,true,false)
Find_/_Replace({'option':'Regex','string':'(\\"{0,1}\\[\\<.+?\\,\\s[a-zA-Z]{0,20}\\])'},'',true,false,true,false)
Find_/_Replace({'option':'Regex','string':'([,a-zA-Z]{1}\\s{0,}?)(\\r{0,1})\\n'},'$1 ',true,false,true,false)
@niikoo
niikoo / useful-registry-tweaks.reg
Last active March 12, 2025 07:29
Useful registry tweaks
Windows Registry Editor Version 5.00
; Speed up Windows Explorer by disabling automatic folder type discovery (for example photos view in folders with photos) [Applied per user]
[-HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags]
[-HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\BagsMRU]
[HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell]
"FolderType"="NotSpecified"
; Not sure if the above was working as expected. Use this instead: https://lesferch.github.io/WinSetView/
; Fix Windows 11 BSOD so that it shows the error code, disable auto reboot and ensure that minidumps and logs are made