Replace
your-company to your company domain. Get Code
#jira #js #javascript #tamper #monkey #tampermonkey #frontend
Please open Telegram to view this post
VIEW IN TELEGRAM
// ==UserScript==
// @name Jira Fast Task Copy Button
// @namespace http://tampermonkey.net/
// @version 2024-05-03
// @description try to take over the world!
// @author You
// @match https://jira.your-company.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=jira.com
// @grant GM_setClipboard
// @grant GM_addStyle
// ==/UserScript==
(function() {
'use strict';
const customStyles = `
.jira-fast-copy-btn {
background-color: #0052CC;
color: white;
padding: 4px 7px 4px 7px !important;
border-radius: 9px;
position: unset !important;
margin-left: 6px !important;
cursor: pointer;
}
.jira-fast-copy-btn_copied {
background-color: green !important;
}
.jira-fast-copy-btn_copied:hover {
background-color: green !important;
}
.jira-fast-copy-btn:hover {
background-color: #0052CCAB;
}
`;
GM_addStyle(customStyles);
let addButton = function (buttonsContainer, text, copy) {
let copyButton = document.createElement('li');
copyButton.className = "jira-fast-copy-btn";
copyButton.innerText = text;
buttonsContainer.appendChild(copyButton);
copyButton.addEventListener("click", function (e) {
copy
? GM_setClipboard(copy)
: alert(text + " not found 4 copy!");
copyButton.classList.add("jira-fast-copy-btn_copied");
setTimeout(function () {
copyButton.classList.remove("jira-fast-copy-btn_copied")
}, 500);
})
}
let alreadyExists = false;
const handleNewNode = (mutationsList, observer) => {
mutationsList.forEach(mutation => {
mutation.addedNodes.forEach(node => {
let buttonsContainer = document.querySelector("header#stalker .aui-nav.aui-nav-breadcrumbs");
if (!buttonsContainer || alreadyExists) {
return;
}
alreadyExists = true;
let id = document.getElementsByClassName("issue-link")[0];
if (id) {
id = id.innerText;
}
let name = document.getElementById("summary-val");
if (name) {
name = name.innerText;
}
addButton(
buttonsContainer,
"Copy Key",
id
);
addButton(
buttonsContainer,
"Copy Summary",
name
);
addButton(
buttonsContainer,
"Copy Key & Summary",
`[${id}] ${name}`
);
let link = document.location.protocol + "//" + document.location.hostname + "/browse/" + id;
addButton(
buttonsContainer,
"Copy Link",
link
);
addButton(
buttonsContainer,
"Copy Key & Summary & Link",
`[${id}] ${name}\n${link}`
);
observer.disconnect();
});
});
};
const config = { childList: true, subtree: true };
const observer = new MutationObserver(handleNewNode);
observer.observe(document.body, config);
})();
For english interface
For Russian interface:
setInterval(function () {
video = document.getElementsByTagName('ytd-playlist-video-renderer')[0];
video.querySelector('#primary button[aria-label="Меню действий"]').click();
var things = document.evaluate(
'//span[contains(text(),"Удалить из плейлиста")]',
document,
null,
XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
null
);
for (var i = 0; i < things.snapshotLength; i++) {
things.snapshotItem(i).click();
}
}, 500);#google #youtube #watch #later #js #javascript #frontend #script
Please open Telegram to view this post
VIEW IN TELEGRAM
alias command-stack='current_dir=$(pwd); cd /var/www/any-dir/; cmd-one; cmd-two; cd "${current_dir}"'Example:
alias proxy='current_dir=$(pwd); cd /var/www/docker-ports-proxy/; make; cd "${current_dir}"'#linux #bash #alias #cd #shell #sh #proxy #script
Please open Telegram to view this post
VIEW IN TELEGRAM
<?php
/**
* Converts a JSON string to PHP array code using the new square bracket syntax with proper indentation
*
* @param string $jsonString JSON string to convert
* @return string PHP code representing the array
*/
function jsonToPhpArrayCodeNewSyntax($jsonString) {
// Decode the JSON string to a PHP array
$array = json_decode($jsonString, true);
// Check for decoding errors
if (json_last_error() !== JSON_ERROR_NONE) {
return 'Error decoding JSON: ' . json_last_error_msg();
}
// Convert the array to PHP code with square bracket syntax
return '$data = ' . arrayToPhpCode($array) . ';';
}
/**
* Recursively converts an array to PHP code using square bracket syntax with proper indentation
*
* @param mixed $array The array to convert
* @param int $indentLevel Current level of indentation
* @return string PHP code representing the array
*/
function arrayToPhpCode($array, $indentLevel = 0) {
if (!is_array($array)) {
return var_export($array, true);
}
$code = "[\n";
$indentation = str_repeat(' ', $indentLevel + 1);
foreach ($array as $key => $value) {
$code .= $indentation;
$code .= is_int($key) ? '' : var_export($key, true) . ' => ';
$code .= arrayToPhpCode($value, $indentLevel + 1) . ",\n";
}
$code .= str_repeat(' ', $indentLevel) . "]";
return $code;
}
$jsonString = <<<JSON
{
"name": "Roman",
"age": 27,
"city": "Omsk",
"address": {
"street": "Lenina",
"number": 26
}
}
JSON;
echo jsonToPhpArrayCodeNewSyntax($jsonString) . PHP_EOL;
Input:
{
"name": "Roman",
"age": 27,
"city": "Omsk",
"address": {
"street": "Lenina",
"number": 26
}
}Output:
$data = [
'name' => 'Roman',
'age' => 27,
'city' => 'Omsk',
'address' => [
'street' => 'Lenina',
'number' => 26,
],
];
#php #js #json #javascript #converter #gpt
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥2
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
- Click Class in Tree View
- Context Menu
- Diagram
- Show Diagram ... / Ctrl + Alt + Shift U
- Click Class on Diagram
- Show Implementations / Ctrl + Alt + B
- Ctrl + A
- Enter
- Click on Needed Class
- Context Menu
- Selected Element Actions
- Jump to Source / F4
#PhpStorm #JetBrains #idea #intelijidea #graph #class #tree #extends #implements #view #parent #child #diagram
Please open Telegram to view this post
VIEW IN TELEGRAM