This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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") { |