Skip to content

Instantly share code, notes, and snippets.

View freaktechnik's full-sized avatar
🚞
I like trains

Martin Giger freaktechnik

🚞
I like trains
View GitHub Profile
function party() {
const colors = Array.from(document.styleSheets).find(stylesheet =>
stylesheet.href.endsWith("colors.css")
).cssRules[0].style;
const colorVariables = Object.values(colors);
const sourceStyles = document.documentElement.style.getPropertyValue(
colorVariables[0]
)
? document.documentElement.style
: colors;
'use strict';
const {messageValue, reply, random, isBot} = require('../server/tools');
const config = require('../config');
require('dotenv').config();
var CLIENT_ID = config.twitch.TWITCH_CLIENT_ID;
var CLIENT_SECRET = config.twitchTWITCH_SECRET;
var GET_TOKEN = config.twitch.TOKENURL;
var GET_STREAM = config.twitch.TWITCH_GET_USER_URL;
var TOKEN = config.twitch.TWITCH_CURRENT_TOKEN;
@freaktechnik
freaktechnik / lichtensteien.js
Last active April 26, 2024 22:05
Just a random user script
// ==UserScript==
// @name Lichtensteien
// @namespace Violentmonkey Scripts
// @include http://*
// @include https://*
// @include *
// @grant none
// @version 1.0
// @author Martin Giger
// @description 11/10/2020, 1:40:47 PM
@freaktechnik
freaktechnik / qobuz.js
Created October 13, 2020 20:59
Qobuz makes you download individual tracks in big orders. This automatically downloads an entire album.
async function download(album) {
const albums = document.querySelectorAll('.order-tracklisting .table');
const target = albums[album];
const downloads = target.querySelectorAll('.btn.tracks');
function wait(time) {
return new Promise((resolve) => setTimeout(resolve, time));
}
for (const button of downloads) {
button.click();
console.log('download');
@freaktechnik
freaktechnik / caldva.diff
Created August 22, 2020 13:58
vikunja caldav testing
diff --git a/pkg/routes/caldav/listStorageProvider.go b/pkg/routes/caldav/listStorageProvider.go
index 1abc683..967d1e3 100644
--- a/pkg/routes/caldav/listStorageProvider.go
+++ b/pkg/routes/caldav/listStorageProvider.go
@@ -17,14 +17,15 @@
package caldav
import (
+ "strconv"
+ "strings"
document.addEventListener('DOMContentLoaded', () => {
document.getElementById('play').addEventListener('click', async () => {
const player = new Audio();
document.body.append(player);
player.src = browser.runtime.getURL('pop.flac');
document.getElementById('output').value = 'playing';
try {
await player.play();
document.getElementById('output').value = 'played!';
var myState = {
counter: 0,
greeted: false,
};
browser.tabs.onCreated.addListener(() => {
myState.counter = 0;
});
browser.runtime.onMessage.addListener((message) => {
@freaktechnik
freaktechnik / bot.land.d.ts
Last active October 13, 2019 18:26 — forked from mizzao/bot.land.d.ts
Bot Land TypeScript bindings
declare const IS_OWNED_BY_ME = 256;
declare const ALLY = 0;
declare const ENEMY = 1;
declare const CHIP = 1024;
declare const CPU = 512;
declare const BOT = 8;
declare const ANYTHING;
declare enum EntityMatchFlags {
IS_OWNED_BY_ME = 256,
const uuid = require("uuid/v4");
exports.DynamicMultipleThings = class MultipleThings {
/**
*
* @param {string} name
*/
constructor(name) {
this.name = name;
this.things = new Map();