Skip to content

Instantly share code, notes, and snippets.

View niikoo's full-sized avatar
🐌

Nikolai Ommundsen niikoo

🐌
View GitHub Profile
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 July 7, 2021 21:17
Prevent clicking entries in 'skattelisten'
// ==UserScript==
// @name Prevent clicking search results in "Skattelisten".
// @namespace http://tampermonkey.net/
// @version 0.3.3
// @author niikoo
// @match https://tjenester.skatteetaten.no/personsok
// @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
// @icon https://icons.duckduckgo.com/ip2/skatteetaten.no.ico
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
@niikoo
niikoo / GM_XHR.js
Created August 13, 2020 22:08 — forked from monperrus/GM_XHR.js
allows using all Jquery AJAX methods in Greasemonkey
// allows using all Jquery AJAX methods in Greasemonkey
// inspired from http://ryangreenberg.com/archives/2010/03/greasemonkey_jquery.php
// works with JQuery 1.5
// (c) 2011 Martin Monperrus
// (c) 2010 Ryan Greenberg
//
// Usage:
// $.ajax({
// url: '/p/',
// xhr: function(){return new GM_XHR();},
@niikoo
niikoo / IMDb Utility Library (API).js
Created January 13, 2020 18:21
Utility library for the Internet Movie Database. Provides an API for grabbing info from IMDb.com
// ==UserScript==
// @name IMDb Utility Library (API)
// @namespace driver8.net
// @version 0.1.1
// @description Utility library for the Internet Movie Database. Provides an API for grabbing info from IMDb.com
// @author driver8
// @match *://*.imdb.com/*
// @grant GM_xmlhttpRequest
// @connect imdb.com
// ==/UserScript==