Skip to content

Instantly share code, notes, and snippets.

View treischl's full-sized avatar

Tristan Reischl treischl

View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<packages>
<!-- base packages -->
<package id="dotnetcore-sdk" />
<package id="powershell-core" />
<package id="python" />
<!-- video drivers -->
<package id="geforce-experience" />
<package id="geforce-game-ready-driver" />
@treischl
treischl / Turnip Exchange - Remove Uninteresting Islands.user.js
Created May 28, 2020 15:49
Removes islands with a different date and selling price < 500 bells/turnip
// ==UserScript==
// @name Turnip Exchange - Remove Uninteresting Islands
// @namespace http://turnip.exchange/
// @version 0.1.0
// @description Removes islands with a different date and selling price < 500 bells/turnip
// @author Tristan Reischl
// @match https://turnip.exchange/islands
// @grant none
// @run-at document-end
// ==/UserScript==
@treischl
treischl / jira-prepare-commit-msg-hook.sh
Last active April 24, 2020 21:25
Script to set up a prepare-commit-msg hook that prepends a Jira ticket from the current branch name
#!/bin/sh
#
# Sets up a prepare-commit-msg hook following the instructions from
# https://bitbucket.org/atlassian/workspace/snippets/qedp7d#comment-3845328
#
# After running, a commit of "Fixed bugs" on branch "ABC-1337-so-many-bugs"
# will be rewritten as "ABC-1337: Fixed bugs"
HOOKS_DIR=~/.git_template/hooks
SNIPPET_URL=https://bitbucket.org/!api/2.0/snippets/atlassian/qedp7d/987c509c28423f235a5717d7d0e71a59cf47ebf1/files/prepare-commit-msg
@treischl
treischl / Program.cs
Created October 3, 2019 14:19 — forked from DanielSWolf/Program.cs
Console progress bar. Code is under the MIT License: http://opensource.org/licenses/MIT
using System;
using System.Threading;
static class Program {
static void Main() {
Console.Write("Performing some task... ");
using (var progress = new ProgressBar()) {
for (int i = 0; i <= 100; i++) {
progress.Report((double) i / 100);
@treischl
treischl / strsim.js
Created May 7, 2019 22:58 — forked from Techcable/strsim.js
Javascript Damerau Levenshtein Similarity metrics
function damerau_levenshtein(first, second) {
"use strict";
// TODO: Support non-BMP characters (like that's ever going to happen)
if (first == second) return 0;
var firstLen = first.length;
var secondLen = second.length;
if (firstLen == 0) return secondLen;
if (secondLen == 0) return firstLen;
var cellIndices = {
'2KM' : 2,
'5KM' : 3,
'10KM' : 4,
};
fetch('/egg-distances')
.then(r => r.text())
.then((respText) => {
let eggs = {};
let doc = document.createElement('html');
@treischl
treischl / bruery-remove-sold-out-allocations.js
Created December 23, 2016 21:07
Remove all Sold Out allocations from The Bruery store's member section.
(() => {
let divs = document.getElementsByClassName('vs2x-row'),
toRemove = [];
Array.prototype.forEach.call(divs, (div) => {
if (div.innerText.indexOf('Sold Out') > 0) toRemove.push(div);
});
toRemove.forEach((div) => div.remove());
})();
@treischl
treischl / GetLDAPUsersWithPagerFields.cs
Created November 7, 2016 21:57
Pull all users in LDAP with a populated pager field
using System.DirectoryServices;
using System.Linq;
public struct User
{
public string pager;
public string samaccountname;
}
public List<User> GetLDAPUsersWithPagerFields()