Skip to content

Instantly share code, notes, and snippets.

View efogdev's full-sized avatar
🧐

Artem efogdev

🧐
  • Spendbase
  • Kharkiv, Ukraine
View GitHub Profile
#!/usr/bin/bash
# usage: ./compress.sh data-dir
format_size() {
num=$1
if [ "$num" -lt 1024 ]; then
echo "${num} B"
elif [ "$num" -lt $((1024 * 1024)) ]; then
echo "$(bc <<< "scale=2; $num/1024") KB"
elif [ "$num" -lt $((1024 * 1024 * 1024)) ]; then
$scope.$watch('suggestions', function (value) {
if (value.length == 0) {
element.find('.autocomplete-suggestions').scrollTop(0);
}
});
$scope.$watch('selectedSuggestion', function (value) {
var suggestionHeight = (element
.find('.suggestion') || {})
.height();
function ($scope, element) {
var options = $scope.options || {};
$scope.playing = false;
var thumbnailUrl = $scope.thumbnailUrl = options.img || '',
videoUrl = options.videoUrl || '',
title = $scope.title = options.mediaTitle || 'Unknown Title',
description = options.description || '',
id = options.id || -1,
// ==UserScript==
// @name Pikabu-like navigation
// @namespace http://*.*/
// @version 0.1
// @author Efog
// @grant none
// ==/UserScript==
document.addEventListener("keydown", function(e) {
if (document.activeElement.nodeName == "BODY") {