Skip to content

Instantly share code, notes, and snippets.

View dantodev's full-sized avatar
🥷
hunting bugs

Daniel Kahl dantodev

🥷
hunting bugs
View GitHub Profile
@dantodev
dantodev / tm-jira-swimlane-header.js
Last active August 17, 2023 08:26
Tampermonkey Script - [Jira] Add Story Points swimlane
// ==UserScript==
// @name [Jira] Show SP on Swimlane
// @description Show open, done and total story points on jira swimlanes
// @author Daniel Kahl
// @version 1.0
// @match https://kanasoftware.jira.com/jira/software/c/projects/VOC/boards/*
// @namespace http://tampermonkey.net/
// @downloadURL https://gist.githubusercontent.com/dantodev/8179ce45abf36a3fbc5bcc815653deeb/raw/tm-jira-swimlane-header.js
// @updateURL https://gist.githubusercontent.com/dantodev/8179ce45abf36a3fbc5bcc815653deeb/raw/tm-jira-swimlane-header.js
// @grant GM_log
@dantodev
dantodev / rules-engine-example.js
Last active November 18, 2021 16:40
Rules Engine Example.js
window.xmSDK.require(["rules-engine"], ({ rulesEngine }) => {
const actions = rulesEngine.actions;
const conditions = rulesEngine.condition;
// show badge for 10% of the users that then opens a layered survey
rulesEngine.createPipeline(pipeline => {
pipeline.add(actions.diceRate({ all: 10 }));
pipeline.add(actions.showBadge({ position: "right" }));
pipeline.add(actions.showLayerSurvey({ surveyId: "survey-id" }));
});
function createObservable(observerCallback) {
if (typeof observerCallback !== "function") {
throw new TypeError("createObservable() must be be called with callback function");
}
let started = false;
let observable = {};
let disposeCallback = null;
let errorCallback = null;
let completeCallback = null;
@dantodev
dantodev / export-spotify-playlist-as-json.js
Last active April 25, 2023 22:40
Exports a playlist from the Sportify web client as JSON.
(() => {
function mapItem(itemNode) {
return {
title: getText(itemNode, '.tracklist-name'),
artist: getText(itemNode, '.TrackListRow__artists'),
album: getText(itemNode, '.TrackListRow__album'),
duration: getText(itemNode, '.tracklist-duration'),
unplayable: itemNode.matches('.tracklist-row-unplayable')
};
}
function createElement(tagName, config) {
if (tagName instanceof Object) {
config = tagName;
tagName = null;
}
config = Object.assign({
tagName: tagName || 'div',
className: null,
class: null,
attr: null,