This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
((raw) => { | |
if(raw == null || raw === '') throw new Error('No data provided'); | |
let data = raw.split(';'); | |
if(data.length === 1) { | |
data = raw.split(','); | |
} | |
if(data.length < 1) { | |
throw new Error('No words to add...'); | |
} | |
if(!confirm(`Are you sure you want to add '${data[0]}' and ${data.length - 1} other words?`)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
meta { | |
title: "iD (modified)"; | |
description: "Renders roads, waterways, landuse, and other features like iD. Based on: https://josm.openstreetmap.de/wiki/Styles/iD"; | |
version: "0.7"; /* don't remove the revision variable */ | |
author: "Nikolai Ommundsen & Leif Rasmussen"; | |
link: "https://gist.github.com/niikoo/f55491d1cbe6ae43f24add124d73072f"; | |
min-josm-version: "7193"; | |
} | |
canvas { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get the ID and security principal of the current user account | |
$myWindowsID=[System.Security.Principal.WindowsIdentity]::GetCurrent() | |
$myWindowsPrincipal=new-object System.Security.Principal.WindowsPrincipal($myWindowsID) | |
# Get the security principal for the Administrator role | |
$adminRole=[System.Security.Principal.WindowsBuiltInRole]::Administrator | |
# Check to see if we are currently running "as Administrator" | |
if ($myWindowsPrincipal.IsInRole($adminRole)) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<presets xmlns="http://josm.openstreetmap.de/tagging-preset-1.0" shortdescription="JOSM Presets Norway" description="Presets used specifically in Norway" author="niikoo" version="0.1"> | |
<group name="Roads (NO)" no.name="Veier (NO)"> | |
<item name="Driveway" no.name="Innkjørsel / oppkjørsel" type="way"> | |
<key key="highway" value="service" /> | |
<key key="service" value="driveway" /> | |
</item> | |
</group> | |
</presets> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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();}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 ;; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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, "..")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |