Skip to content

Instantly share code, notes, and snippets.

dhoko dhoko

Block or report user

Report or block dhoko

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dhoko
dhoko / resizeZipImg.sh
Created Feb 7, 2019
Resize Zip/rar with images
View resizeZipImg.sh
#!/usr/bin/env bash
set -eo pipefail
IFS=$'\n'
function getExtension {
local file =$(basename -- "$1");
echo "${1##*.}";
}
function convertImages {
cd "$1";
@dhoko
dhoko / resizeHD.bash
Last active Dec 1, 2018
Resize a video (mp4/wmv) to HD (720p)
View resizeHD.bash
#!/bin/bash
set -eo pipefail
FILENAME=$(basename -- "$1");
EXT="${FILENAME##*.}";
NAME="${FILENAME%.*}";
OUTPUT=$(echo "$NAME-2.$EXT");
echo $FILENAME;
echo $OUTPUT;
@dhoko
dhoko / menacheGithubBranches.js
Created Jun 11, 2018
Remove merged branches
View menacheGithubBranches.js
{
const list = $$('.js-branch-row');
const toRemove = list.filter((node) => {
return node.querySelector('.State--purple');
});
toRemove.forEach((node) => {
node.querySelector('.State--purple').textContent = 'DONE'
});
if (!toRemove.length) {
View protoncss.css
/*
Source https://scastiel.gitlab.io/protonmail-theme-creator/
*/
body section.sidebar ul.menu li a,
body section.sidebar ul.menu li:hover a,
body section.sidebar ul.menu li a i.fa,
body section.sidebar ul.menu li:hover a i.fa,
body section.sidebar ul.menu li a button.fa-repeat,
body section.sidebar ul.menu li:hover button.fa-repeat,
@dhoko
dhoko / video2gif.sh
Last active Apr 15, 2019
Convert a video to gif (webm/mp4)
View video2gif.sh
#!/bin/bash
#
inputFile=$1
FPS=15
WIDTH=$2
OUTPUT='output.gif';
PALETTE_OUTPUT='tmp_palette.png';
@dhoko
dhoko / remove-gihtub-branch.js
Created Sep 26, 2016
Remove :merged github
View remove-gihtub-branch.js
Array
.from($$('.state-merged'))
.map(node => node.parentElement.parentElement.querySelector('button'))
.forEach(node => node.click())
@dhoko
dhoko / int.string.js
Created Aug 12, 2016
Convert Uint8Array to a string
View int.string.js
String.fromCharCode.apply(null, data);
// data = new Uint8Array...
@dhoko
dhoko / debug-property.window.js
Created Aug 12, 2016
Watch new property attach to window with a stacktrace
View debug-property.window.js
Object.defineProperty(window, 'data', {set: function () {console.trace()}, get: function () {return 1}});
View amazonTotalCommands.js
$$('span.value:last-of-type')
.map(node => node.textContent.trim())
.filter(txt => txt.indexOf('EUR') === 0)
.map(txt => txt.split('EUR')[1].trim().replace(',','.'))
.reduce((a,b) => a + +b, 0)
@dhoko
dhoko / listDirectives.js
Last active Feb 12, 2019
AngularJs - get list of all registered directives
View listDirectives.js
const listDirectivesApp = () => {
const listDirectives = name => {
return angular
.module(name)
._invokeQueue
.filter(item => 'directive' === item[1])
.map(item => item[2][0]);
};
return angular
You can’t perform that action at this time.