Skip to content

Instantly share code, notes, and snippets.

anatoly techtonik techtonik

Block or report user

Report or block techtonik

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
techtonik /
Created Jul 9, 2017
Commit file versions using their timestamps as commit date
import os
from shellrun import run
from datetime import datetime
hist = sorted([name for name in os.listdir('.') if name.startswith('appvey') and name != ''])
for f in hist:
tstamp = datetime.fromtimestamp(os.path.getmtime(f))
run('copy {}'.format(f))
View glretrace2gif
glretrace.exe -s - input.trace | ffmpeg -r 75 -f image2pipe -vcodec ppm -i pipe: -r 25 -qscale 3.1 -y output.ogg
# get palette
ffmpeg -y -i output.ogg -vf fps=10,scale=320:-1:flags=lanczos,palettegen palette.png
# write gif
ffmpeg -i output.ogg -i palette.png -filter_complex "fps=10,scale=320:-1:flags=lanczos[x];[x][1:v]paletteuse" output.gif
# links:
# -
# -
techtonik / argi.go
Last active Sep 17, 2016
Go - show program name and arguments
View argi.go
// go run argi.go
package main
import "os"
import "fmt"
func main() {
fmt.Println("prog:", os.Args[0])
if len(os.Args) > 1 {
fmt.Println("args:", os.Args[1:])
techtonik /
Last active Sep 6, 2016
Good practices for handling open source projects
techtonik / pp.go
Created Sep 3, 2016
Go - PP() - pretty printer for variables
View pp.go
package pp
import (
// Pretty print structures. Uses "encoding/json" to
// convert nested structure to indented string.
func PP(v interface{}) {
techtonik /
Last active Oct 29, 2019
Using Python with Far Manager
View gist:b9523fc8ef841a1074afb75e2d9bfdf6
# prepare pager
less = 'less'
if IS_WIN:
with open(ROOT + '\\git.bat') as r:
for line in r:
start = line.find('%~dp0')
if start != -1:
GIT_DIR = line[start+5:line.find('\cmd')]
less = ROOT + '\\' + GIT_DIR + '\\usr\\bin\\less'
techtonik / gist:2c741ee7dccbe86dbc5d8011641496d2
Last active Jul 20, 2016
How to hack Google's depot_tools
View gist:2c741ee7dccbe86dbc5d8011641496d2
* [ ] See branch name on Rietveld
* [ ] Fetch branch from Rietveld
* [ ] git sync instead of (rebase-update)
* [ ]
>git rebase-update
Fetching origin
remote: Counting objects: 1110, done
remote: Finding sources: 100% (30/30)
techtonik /
Last active Jun 18, 2016
cross-platform package info
packaging for humans (tm)..
humans are easily overloaded with information, so
this should be the intuitive way to express and
solve what humans want.
001 get what package does
pk show <name>
techtonik /
Last active May 21, 2016
Driver inheritance pattern - parent should print child's name

See and try to implement the same in C++ with and without using templates.

$ python 

$ g++ -std=c++14 -O2 -Wall -pedantic main.cpp && ./a.out
You can’t perform that action at this time.