Skip to content

Instantly share code, notes, and snippets.

@koteq
koteq / disable_output_buffering.php
Last active December 1, 2022 04:32
How to disable output buffering
<?php
// http/1.1 header to disable browsers cache
header('Cache-Control: no-cache');
// tell nginx to disable buffering
header('X-Accel-Buffering: no');
// disable apache mod_gzip and mod_deflate
apache_setenv('no-gzip', 1);
@koteq
koteq / mal_sort_plan2watch.js
Last active September 23, 2021 19:40
myanimelist.net sort plan to wach by rank #mal
// go to your myanimelist.net
// click "Plan to Watch"
// scrooll all the way down
// exec this from console
const calc_weight = function (score, users) {
const mean = 7.0;
const minimum = 30000.0;
return (score * users + mean * minimum) / (users + minimum); // imdb top250
};
/**
* DIR-655 Network Monitor.
* Based on Network Monitor v2.0 for Yahoo! Widgets.
*/
let lan_tx_bytes;
let lan_rx_bytes;
let last_timestamp;
const readValues = () => {
# coding: utf-8
# based on http://baguzin.ru/wp/?p=7873
import re
class AssParser:
def __init__(self):
self.dialog_re = re.compile(r'Dialogue:(?:[^,]*,){9}(.*)')
@koteq
koteq / qbittorrent web api add torrent (utorrent).pyw
Created July 10, 2016 00:23
Adapter to pair Taiga with qBittorrent
#!/usr/bin/env python3
import os
import sys
import argparse
# pip install requests
import requests
def main():
@koteq
koteq / gen.sh
Created September 25, 2017 14:57
openssl self-signed certificate creation for web server
set -e
if [ -z "$1" ]; then
hostname="$HOSTNAME"
else
hostname="$1"
fi
local_openssl_config="
[req]
@koteq
koteq / gplus_img_title.user.js
Created June 23, 2017 11:44
G+ hover image title
// ==UserScript==
// @name G+ hover image title
// @version 1.0
// @match *://plus.google.com/*
// @run-at document-end
// @grant none
// ==/UserScript==
/* jshint esnext: true */
const decodeFileName = (src) => {
// ==UserScript==
// @name Sankaku fast pagination
// @version 0.1
// @match *://chan.sankakucomplex.com/*
// @grant none
// @run-at document-start
// ==/UserScript==
/* jshint esnext: true */
const originalSetTimeout = window.setTimeout;
@echo off
:: WARNING: after some testing considered as not recommended.
:: Filter to keep only non similar frames.
:: It selects only first frame `eq(n\,0)`
:: and frames with differences `gt(scene\,{sensivity})`
:: see https://ffmpeg.org/ffmpeg-filters.html#select_002c-aselect
set similar_frames_sensivity=0.002
set skip_similar_frames=select=eq(n\,0)+gt(scene\,%similar_frames_sensivity%)
:: Adaptive Temporal Averaging Denoise.
// ==UserScript==
// @name G+ two columns mode
// @version 0.1
// @match https://plus.google.com/*
// @grant none
// @run-at document-start
// ==/UserScript==
window.innerWidth = 1200;