Skip to content

Instantly share code, notes, and snippets.

View lukepothier's full-sized avatar

Luke Pothier lukepothier

View GitHub Profile
// ==UserScript==
// @name Trello Card Colour
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Colours Trello cards according to their labels
// @author Luke Pothier
// @match https://trello.com/b/*
// @grant none
// ==/UserScript==
@lukepothier
lukepothier / Defeat supercookie.js
Last active October 15, 2022 23:38
Tampermonkey script to prevent websites from tracking you using favicon fingerprinting
// ==UserScript==
// @name Defeat supercookie (https://github.com/jonasstrehle/supercookie)
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Prevent websites from tracking you using favicon fingerprinting
// @author Luke Pothier <[email protected]>
// @match https://*/*
// @match http://*/*
// @grant none
// ==/UserScript==
@lukepothier
lukepothier / Skip tinyurl.is.js
Last active February 7, 2021 20:15
Tampermonkey script which skips annoying tinyurl.is redirects
// ==UserScript==
// @name Skip tinyurl.is
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Skip tinyurl.is redirects
// @author Luke Pothier <[email protected]>
// @match https://tinyurl.is/*
// @grant none
// ==/UserScript==
@lukepothier
lukepothier / Jira Swimlane Status Helper.js
Last active November 2, 2021 18:41
Tampermonkey script which changes Jira ticket 'lozenges' to more accurately relay the state of the ticket based on the states of the subtasks. You may need to change the match or the text filters depending on your project set-up.
// ==UserScript==
// @name Jira Swimlane Status Helper
// @namespace http://tampermonkey.net/
// @version 1.0.0
// @description Change text and colour of Jira 'lozenges' on the Rapid Board to more accurately reflect the state of each ticket
// @author Luke Pothier <[email protected]>
// @match https://*.atlassian.net/jira*
// @grant none
// ==/UserScript==
@lukepothier
lukepothier / SitemapService.cs
Created August 14, 2018 19:54
Get valid URLs from sitemap (no spidering because I'm lazy)
public IEnumerable<Uri> GetSitemapUrls(Uri sitemapUrl)
{
var sitemapText = GetSitemapText(sitemapUrl);
if (string.IsNullOrWhiteSpace(sitemapText))
yield break;
var urlRegex = new Regex(@"\b(?:https?://|www\.)[^ \f\n\r\t\v\]]+\b", RegexOptions.Compiled | RegexOptions.IgnoreCase);
foreach (Match m in urlRegex.Matches(sitemapText))
using System;
using System.Collections.Generic;
namespace Blackjack
{
internal class Player
{
public string Name { get; set; }
public ICollection<Card> Hand { get; set; }
}
@lukepothier
lukepothier / EncryptionService.cs
Last active March 15, 2018 10:09
AES & HMAC encryption and decryption for UTF-8 strings. Modified from original by Jay Tuley.
using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;
namespace YourNamespace
{
public class EncryptionService : IEncryptionService
{
static readonly RandomNumberGenerator _random = RandomNumberGenerator.Create();
@lukepothier
lukepothier / BottomNavigationItemSelectedTargetBinding.cs
Created March 26, 2017 08:13
MvxConvertingTargetBinding for Android navigation views which have IMenu members
using Android.Support.Design.Widget;
using MvvmCross.Binding;
using MvvmCross.Binding.Bindings.Target;
using System;
using System.Windows.Input;
namespace YourNamespace
{
public class NavigationItemSelectedTargetBinding : MvxConvertingTargetBinding
{