Skip to content

Instantly share code, notes, and snippets.

Andrey Tarantsov andreyvit

Block or report user

Report or block andreyvit

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

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

# remap prefix to Control + a
andreyvit / fpdi_with_annots.php
Created Mar 12, 2012
FPDI extension to preserve external hyperlinks
View fpdi_with_annots.php
// FPDI extension that preserves hyperlinks when copying PDF pages.
// (c) 2012, Andrey Tarantsov <>, provided under the MIT license.
// Published at:
// Note: the free version of FPDI requires unprotected PDFs conforming to spec version 1.4.
// I use qpdf ( to preprocess PDFs before running through this

Memory Leak Report

Many web apps leak memory on IE11 despite running fine on other browsers. We've identified two main causes of this.

The first kind of leak is simple, entirely predictable and caused by a quirk in how IE's JavaScript engine handles closures. Let's call it an “undead closure leak”. This leak goes away if you properly clean up all references or reload the page, and thus affects only AJAXy parts of the apps.

The second kind of leak is a complex permanent one, leaking the entire page context even if you reload the page. Let's call it a “GC singularity leak”. It's triggered by certain JavaScript code patterns, seemingly because IE's garbage collector never finishes its job (our theory is that it exhibits exponential complexity and encounters some sort of timeout/threshold).

This might not be an exhaustive list; internet posts point to other issues, notably when handling IFRAMEs, but we haven't encountered any of these.

View Delegate-README.txt
В этой директории лежит delegate (универсальный прокси-сервер и сервер
контекта) для Windows. Остальные версии можно найти на сайте.
Вот примерный список функций:
* входящие (т.е. с вашего компьютера) соединение по протоколам
HTTP, HTTPS, "HTTPS-tunnel", FTP, NNTP, Telnet, SOCKS и др.
* исходящие соеднинения (т.е. к настоящим серверам) по тем же
протоколам, причём, например, можно FTP (на входе) пустить
через SOCKS-прокси (или через HTTPS-прокси)
* кэширование запросов (с управляемыми параметрами)
andreyvit / Rakefile
Created Apr 16, 2012
Rake tasks to initialize a new Mac
View Rakefile
desc "Install zsh config"
task :zshconfig do
sh 'chsh -s /bin/zsh'
sh 'rm -f ~/.zshrc ~/.zshenv'
sh 'ln -s ~/env/config/zshenv ~/.zshenv'
sh 'ln -s ~/env/config/zshrc ~/.zshrc'
desc "Install ssh config"
task :sshconfig do
andreyvit / DockIcon.h
Created Mar 25, 2012
Show in Dock / Menu Bar / Nowhere coordinator
View DockIcon.h
#import <Foundation/Foundation.h>
typedef enum {
} AppVisibilityMode;
andreyvit / filter-windbg-address-map.go
Created Dec 5, 2018
A script to filter and summarise the memory map produced by `!address` command in WinDbg (requires Go 1.11)
View filter-windbg-address-map.go
package main
import (
andreyvit / ie11leak.html
Created Nov 20, 2018
A minimal reproduction case for a weird IE11 memory leak
View ie11leak.html
<!DOCTYPE html>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<script crossorigin src=""></script>
(function () {
var doc = document;
View livereload.js
// see for an up-to-date version
(function() {
var __protocol = {}, __connector = {}, __timer = {}, __options = {}, __reloader = {}, __livereload = {}, __startup = {};
// protocol
(function() {
var PROTOCOL_6, PROTOCOL_7, Parser, ProtocolError;
var __indexOf = Array.prototype.indexOf || function(item) {
andreyvit /
Created Mar 24, 2012
A script to remove old DB backup files, keeping one backup per month, one backup per day for the last X months and the last Y backups.
#! /bin/bash
# vim: sw=2 ts=2 et ai
# Deletes old DB backup files from the folder specified as an argument.
You can’t perform that action at this time.