Skip to content

Instantly share code, notes, and snippets.

View shorti1996's full-sized avatar

Wojtek Li shorti1996

  • Wrocław, PL
View GitHub Profile
@shorti1996
shorti1996 / README.md
Created January 17, 2023 18:54 — forked from magnetikonline/README.md
List all Git repository objects by size.

List all Git repository objects by size

Summary

Bash script to:

  • Iterate all commits made within a Git repository.
@shorti1996
shorti1996 / cdlogin_defaults.sh
Last active March 20, 2020 11:52
Channel Digital provision
alias cdlogin='f(){ login="$1"; pass="$2"; [ -z "$login" ] && login=xxx; [ -z "$pass" ] && pass=xxx; for ((n=0;n<4;n++)); do adbkey 19 && sleep 0.2; done && adbtext "$login" && adbkey 66 && sleep 1 && adbtext "$pass" && adbkey 66; unset -f f; }; f'
@shorti1996
shorti1996 / git-review-bitbucket-linux.sh
Last active August 13, 2020 08:53
Git review alias
git config alias.review "\!f() { prnumber=\$1; repo=\$2; [ -z \${repo} ] && repo=base;
git fetch \${repo} pull-requests/\${prnumber}/from && git checkout FETCH_HEAD; }; f"
@shorti1996
shorti1996 / jira_close_subtasks.py
Created January 28, 2020 11:45
JIRA close subtasks
#!python3
import ctypes
import getpass
import re
from jira import JIRA
ctypes.windll.kernel32.SetConsoleTitleW("JIRA subtask closer")
@shorti1996
shorti1996 / LiveDataExtensions.kt
Created January 22, 2020 15:42
LiveData Extensions
import androidx.lifecycle.*
fun <T> MutableLiveData<T>.setValueIfDiffers(newValue: T?, onSet: ((newValue: T?) -> Unit)? = null, onNotSet: (() -> Unit)? = null) {
if (value != newValue) {
value = newValue
onSet?.invoke(newValue)
} else {
onNotSet?.invoke()
}
}
@shorti1996
shorti1996 / copy-jira-issue-bb.js
Last active October 8, 2020 14:42
Tampermonkey scripts
// ==UserScript==
// @name JIRA copy ID and name
// @namespace http://tampermonkey.net/
// @version 0.2
// @description try to take over the world!
// @author You
// @match https://jira.bbqnx.net/browse/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js
// @grant GM_addStyle
// ==/UserScript==
object Scratch {
@JvmStatic
fun main() {
val colorInt = -5327429
val hexColor = colorIntToHex(colorInt)
println("$colorInt is $hexColor")
}
const $ = jQuery;
zip= rows=>rows[0].map((_,c)=>rows.map(row=>row[c]))
console.log([$('td.summary').toArray().reduce((acc, val) => {
acc.titles.push($('a.pull-request-title', val)[0].title);
acc.times.push($('time', val)[0].title);
return acc;
}, {titles: [], times: []})].map((result) => zip([result.titles, result.times]))[0]
.reduce((acc, val) => {
return acc + "\n\n" + val[0] + "\n" + val[1];
}, ""))
@shorti1996
shorti1996 / pinger.php
Created January 3, 2019 12:09
Ping and request in php
<?php
set_time_limit(4);
ob_start();
$file = 'logs.txt';
$date_run = date(DATE_ATOM);
function shutdown () {
global $file;
var trs = $('.wikitable,.sortable tr').slice(2, -1);
trs.toArray().map((el, ind) => { return $('td', el).toArray().map((td, i) => { return td.innerText }) })