Skip to content

Instantly share code, notes, and snippets.

View wmathes's full-sized avatar

Wolf T. Mathes wmathes

View GitHub Profile
@wmathes
wmathes / readme.MD
Created May 8, 2021 03:44
A TamperMonkey-script for Steam Key registrations (particularly useful with Humble Bundle)

Functionality

When activating a product key on the steam website, this TemperMonkey-script automatically clicks the checkbox to accept the "Steam Subscriber Agreement".

If a product key is part of the URL, for instance after clicking "Redeem" on a game code at humblebundle.com, the script will click the Continue-button for you as well.

How to use this

  1. Install the TemperMonkey browser extension (Chrome/Edge)
  2. Create a new script
  3. Copy paste the contents of the file below
@wmathes
wmathes / tm_hide_aws_regions.js
Last active November 1, 2023 08:03
TamperMonkey: Hide AWS regions from dropdown menu.
// ==UserScript==
// @name ScreenCloud AWS: region dropdown cleanup
// @namespace http://tampermonkey.net/
// @version 0.1
// @author wolf@screencloud.io
// @include https://*.console.aws.amazon.com/*
// @grant none
// ==/UserScript==
(function() {
// organization's repository labels (when all labels are expanded)
[...document.getElementsByClassName('js-new-label-name-input')]
.filter((x) => /label-name-\d+/.test(x.id))
.map((x) => x.id.substring(11))
.map((x) => ({
name: document.getElementById(`label-name-${x}`).value,
description: document.getElementById(`label-description-${x}`).value,
color: document.getElementById(`label-color-${x}`).value
}))
@wmathes
wmathes / drop_enum_value.sql
Created June 4, 2019 02:27
Postgres: plpgsql drop enum value function
-- two functions to add and remove values from an enum.
-- reason: there's no easy way of removing a value from an existing enum in postgres.
CREATE OR REPLACE FUNCTION utility.enum_add_value(nspname text, typname text, value text) RETURNS void
AS $$
BEGIN
INSERT INTO pg_enum (enumtypid, enumlabel, enumsortorder)
VALUES (
(
SELECT oid

ScreenCloud GraphQL Guide

This is a short description on how to use the Signage Next GraphQL API.

What is GraphQL?

IF you have 14 minutes, then have a look at this YouTube video: "14 minute What is GraphQL?".

In short GraphQL is a query language, which queries a graph datatree, hence the name GraphQL. // todo: add more stuff here

ScreenCloud Signage GraphQL

Simple Self Signed SSL certifcate (on Win10)

Install openssl for windows

  1. install openssl for windows http://gnuwin32.sourceforge.net/packages/openssl.htm
  2. configure cmd environment. OPENSSL_CONF should point to config file. Usually C:\Program Files (x86)\GnuWin32\share\openssl.cnf.
  3. add C:\Program Files (x86)\GnuWin32\bin to PATH. Run where openssl in cmd to verify it finds the correct file.

Generate your certificate

  1. Edit the config file at OPENSSL_CONF to include your locally signed domain names.
@wmathes
wmathes / LOGISTIC_SHIPPING.md
Created August 21, 2017 07:45
Shipping route changes

Dependencies

1) HarmonizedSystem (HS) Codes

It's used in almost all systems, we should have it as a php 5.3 package. The AasTariff-class from Shop is already quite good:

  • it should return a class instance though (HsCode-instance, immutable and lazily constructed)
  • add getDefault()-method.
@wmathes
wmathes / BOT_IDEAS.md
Created July 3, 2017 09:28
Things a bot should do...

These are favoured functionalities for a bot handling github Issues and PR. It has most of the functionalities of WaffleBot as well as others.

states

The bot is mostly focusing on adding/removing labels to issues and PRs to indicate their current state in addition to their open/closed states.

Note that all these labels are considered temporary and are removed from an issue/pr when it closes.

in-progress indicates that work has started on an issue. Reacts to creation of branches with a issue-id prefix (like 123-my-branch) and to commit messages containing an autoclose-tag for the issue.

// Imports from the http-client package
import {ServiceClient} from "@crazy-factory/service-client";
import {ServiceRequestOptions} from "@crazy-factory/service-client";
import {ServiceResponse} from "@crazy-factory/service-client";
// shop-api-client
import {IProductData} from "@crazy-factory/shop-service-data";
// Nodes
class ProductsNode extends ServiceNode {
class ServiceNode {
constructor(protected client: HttpApiClient) {
}
}
class Service {
protected client: ServiceClient;
constructor(config: string | ServiceClient) {