Skip to content

Instantly share code, notes, and snippets.

View 174n's full-sized avatar

Ivan Alexandrov 174n

View GitHub Profile
@174n
174n / json-compression-benchmark.js
Last active April 3, 2021 13:34
JSON compression benchmark
const jsonpack = require("jsonpack");
const lzwcompress = require("lzwcompress");
const cjson = require('compressed-json');
const base2048 = require("base2048");
const Table = require('cli-table');
const data = require("./data.json");
const base64string = data => Buffer.from(data).toString("base64");
const getSize = data => Buffer.byteLength(JSON.stringify(data), 'utf8');
@174n
174n / download.sh
Created January 16, 2021 08:31
Google Street View panoramas downloader
echo "" > files.txt
for i in {0..12}
do
for j in {0..5}
do
printf "https://geo3.ggpht.com/cbk?cb_client=maps_sv.tactile&authuser=0&hl=de&gl=de&panoid=%s&output=tile&x=%d&y=%d&zoom=4&nbt&fover=2\n\tout=images/%d_%d.png\n" $1 $i $j $i $j >> files.txt
done
done
mkdir images
aria2c -q -i files.txt -j 3
@174n
174n / cyrilicWordsHash.js
Last active February 8, 2020 20:10
Hash cyrilic phrases for better searching - still in development
const cyrilicWordsHash = phrase => phrase
.replace(/[^А-Яа-я0-9 ]/g,'')
.toUpperCase()
.split(" ")
.map(word => word.slice(0,1) + word.slice(1)
.replace(/А|Я|О|Ё|У|Ю|Ы|И|Э|Е/g, '')
).filter(word => word.length > 1);
export default cyrilicWordsHash;
@174n
174n / jellyfin.js
Last active January 29, 2020 23:50
UserScript for controlling playback speed in Jellyfin
// ==UserScript==
// @name Speed control - localhost:8096
// @namespace Violentmonkey Scripts
// @include http://localhost:8096/*
// @grant none
// @version 1.0
// @author -
// @description 1/30/2020, 12:16:50 AM
// ==/UserScript==
const mysql = require("mysql");
const faker = require('faker');
faker.locale = "de";
/* Generic stuff
==========================================*/
const getArray = number =>
[...new Array(number)];
@174n
174n / downloadAria2c.bat
Last active June 4, 2019 15:37
download aria2c bat file
@echo off
if not exist "%~dp0aria2c.exe" (
echo Downloading aria2c.exe...
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://uupdump.ml/autodl_files/aria2c.exe', '%~dp0aria2c.exe')"
)
call :checkhash "3eb8712b0db6ba466f8afe1bf606983fe8341c941bdfcadc07068288c7ca5a9c" "aria2c.exe"
goto start
const json2xml = json =>
Object.keys(json)
.map(k =>
typeof json[k] === "object" && k !== "_attr"
? `<${k +
(json[k]["_attr"]
? " " + Object.keys(json[k]["_attr"]).map(
a => `${a}="${json[k]["_attr"][a]}"`
).join(" ")
: "")
@174n
174n / xmpp_bosh_server_list.json
Last active April 8, 2019 18:16
XMPP BOSH server list
[
{
"url": "https://arcipelago.ml:5280/http-bind",
"login": [
"PLAIN",
"SCRAM-SHA-1",
"X-OAUTH2"
],
"register": true,
"capcha": true
@174n
174n / README.md
Last active March 15, 2019 16:48
Terminal IDE

IDE in terminal

Fonts

Nerdfonts: https://nerdfonts.com/

mkdir -p ~/.local/share/fonts && \
cd ~/.local/share/fonts && curl -fLo "Fura Code Regular Nerd Font Complete.otf" https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/FiraCode/Regular/complete/Fura%20Code%20Regular%20Nerd%20Font%20Complete.otf?raw=true
@174n
174n / index.html
Last active January 24, 2019 22:37
textConverter
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>[Text Converter]</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Montserrat:300,400,900'>
<style>
*, input, textarea {