Skip to content

Instantly share code, notes, and snippets.

View niikoo's full-sized avatar
🐌

Nikolai Ommundsen niikoo

🐌
View GitHub Profile
@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
// ==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
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 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
@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
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.
public static class EnumExtensions
{
public static string GetEnumMemberValue<T>(this T type)
where T : Enum
{
var enumType = typeof(T);
var name = Enum.GetName(enumType, type);
var enumMemberAttribute = ((EnumMemberAttribute[])enumType.GetField(name).GetCustomAttributes(typeof(EnumMemberAttribute), true)).Single();
return enumMemberAttribute.Value;
}
@niikoo
niikoo / sign-powershell-script.ps1
Last active October 9, 2020 22:20 — forked from actaneon/signPowershell.ps1
Sign Powershell Script
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
$dialog = New-Object -TypeName System.Windows.Forms.OpenFileDialog
$dialog.AddExtension = $true
$dialog.Filter = 'PowerShell-Script (*.ps1)|*.ps1'
$dialog.Multiselect = $true
$dialog.FilterIndex = 0
$dialog.InitialDirectory = [System.IO.Path]::GetFullPath([System.IO.Path]::Combine($PSScriptRoot, ".."))
@niikoo
niikoo / nvram-clean.sh
Last active September 8, 2020 21:38
OpenWRT nvram-clean.sh for Linksys wrt54gl
# OpenWRT nvram-clean.sh for Linksys wrt54gl
#
# Usage: https://openwrt.org/toh/linksys/wrt54g
#
# Source: https://web.archive.org/web/20140326172212/http://downloads.openwrt.org/people/nbd/nvram-clean.sh
# Version: 1.0
empty() {
case "$1" in
"") return 0 ;;
@niikoo
niikoo / sharepoint-up-actionbtn.user.js
Last active June 28, 2021 17:09
Sharepoint: Add an action button to go 'Up' one folder in the file browser
// ==UserScript==
// @name Sharepoint: Go Up One Folder Action Button
// @namespace https://github.com/niikoo
// @version 0.4.1
// @description Add an action button to go 'Up' one folder in the file browser
// @author niikoo
// @homepage https://gist.github.com/niikoo/a49658ed816b35522831031f6a80992b
// @match https://*.sharepoint.com/*
// @updateURL https://gist.github.com/niikoo/a49658ed816b35522831031f6a80992b/raw/sharepoint-up-actionbtn.user.js
// @downloadURL https://gist.github.com/niikoo/a49658ed816b35522831031f6a80992b/raw/sharepoint-up-actionbtn.user.js