Skip to content

Instantly share code, notes, and snippets.

using System;
using FunctionalProgramming;
namespace FunctionalProgramming
{
public interface IOperation<I, O>
{
O Apply(I arg);
}
@veqtrus
veqtrus / p2pool-vtc-setup-guide.md
Last active April 19, 2020 18:31
Vertcoin (VTC) P2Pool setup guide

Vertcoin (VTC) P2Pool setup guide

Configuring the Vertcoin daemon

After you installed verctoind/vertcoin-qt/"Vertcoin Core" you will need to enable the RPC server. To do so add the following text to your vertcoin.conf file:

server=1
rpcuser=user
rpcpassword=YourSuperGreatPasswordNumber_DO_NOT_USE_THIS_OR_YOU_WILL_GET_ROBBED_385593
@veqtrus
veqtrus / zoopla-bookmarklet.md
Created March 2, 2020 18:06
A bookmarklet for filtering listings by availability date and number of bedrooms.

Zoopla Filter Bookmarklet

A bookmarklet for filtering listings by availability date and number of bedrooms.

Create a bookmark with the following code as URL:

javascript:(function () { var query = prompt("Select months/bedrooms", "may,jun,jul,aug,sep").split(',').map(function (s) { return s.trim().slice(0, 3).toLowerCase(); }); var testBedrooms = query.some(function (q) { return (/\d+/).test(q); }); var listingResults = document.querySelector("ul.listing-results"); Array.from(document.querySelectorAll("ul.listing-results > li")).filter(function (li) { var from = li.getElementsByClassName("available-from"); if (from.length < 1) return true; from = from[0].innerText.split(' '); if (from.length < 4) return true; from = from[3].trim().slice(0, 3).toLowerCase(); if (!query.includes(from)) return true; if (testBedrooms) { var beds = li.getElementsByClassName("num-beds"); if (beds.length > 0) { beds = beds[0].innerText; if (!query.includes(beds)) return true; } }

Inf1 OP : Lab Sheet pagination bookmarklets

Add the following to your bookmarks bar:

Inf1 OP : Prev Q javascript:(function (incr) { if (!window.location.pathname.startsWith("/teaching/courses/inf1/op/")) return; var paths = window.location.href.split("/"); var last = paths[paths.length-1].split("q"); var n = parseInt(last[1].split(".")[0]) + incr; paths[paths.length-1] = last[0] + "q" + n + ".html"; window.location.href = paths.join("/"); })(-1);

Inf1 OP : Next Q javascript:(function (incr) { if (!window.location.pathname.startsWith("/teaching/courses/inf1/op/")) return; var paths = window.location.href.split("/"); var last = paths[paths.length-1].split("q"); var n = parseInt(last[1].split(".")[0]) + incr; paths[paths.length-1] = last[0] + "q" + n + ".html"; window.location.href = paths.join("/"); })(1);

Code

/*
Copyright (c) 2017 Paul Georgiou
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: