Skip to content

Instantly share code, notes, and snippets.

Valentin Tsatskin vtsatskin

Block or report user

Report or block vtsatskin

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
vtsatskin / typescriptreact.json
Last active Feb 27, 2019
VS Code snippet for creating a React PureComponent in TypeScript
View typescriptreact.json
// Place your snippets for TypeScript React here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
"Print to console": {
"prefix": "log",
"body": [
vtsatskin / gist:dd2e3ca81125b6f3e061176744bd2f7f
Created Aug 22, 2017
Running Android emulator through the command line on OSX
View gist:dd2e3ca81125b6f3e061176744bd2f7f
# Add this to your shell profile
export ANDROID_HOME=$HOME/Library/Android/sdk/
alias emulator='cd $ANDROID_HOME/tools/; ./emulator'
# In a new shell
emulator @<avd_name>
View various.versions.out.txt
➜ App git:(story-book) ✗ yarn --version (⌐•_•)
➜ App git:(story-book) ✗ node --version (⌐•_•)
➜ App git:(story-book) ✗ react-native --version (⌐•_•)
react-native-cli: 2.0.1
react-native: 0.44.2
vtsatskin / gist:d78d0f58f3cf440dc6c207b992f51e4f
Created Jun 13, 2017
Add loopback to Network pane in System Preferences on macOS
View gist:d78d0f58f3cf440dc6c207b992f51e4f
sudo networksetup -createnetworkservice Loopback lo0
sudo networksetup -setmanual Loopback

Keybase proof

I hereby claim:

  • I am vtsatskin on github.
  • I am vtask ( on keybase.
  • I have a public key whose fingerprint is 61DB 3B91 BF7C CCA1 8498 E280 9B8E 4D3A 556F 3566

To claim this, I am signing this object:

vtsatskin /
Created Oct 23, 2015
Saving numpy image frames to video with OpenCV
import cv2
import numpy as np
def save_frames(frames, file_path, width, height, fps, codec="mp4v"):
# Define the codec and create VideoWriter object
fourcc =*codec)
out = cv2.VideoWriter(file_path, fourcc, fps, (width,height))
for frame in frames:
vtsatskin /
Created Oct 13, 2015
Listening to KeyPress and KeyRelease with Tkinter with debouncing
import Tkinter as tkinter
tk = tkinter.Tk()
has_prev_key_release = None
When holding a key down, multiple key press and key release events are fired in
succession. Debouncing is implemented in order to squash these repeated events
and know when the "real" KeyRelease and KeyPress events happen.
vtsatskin / tableFlip.theme
Last active Aug 29, 2015 — forked from dhuynh/tableFlip.theme
Table Flip oh-my-zsh theme
View tableFlip.theme
autoload -Uz vcs_info
autoload -U add-zsh-hook
add-zsh-hook precmd mtmdd_precmd
add-zsh-hook preexec mtmdd_preexec
# Table flip
typeset -A table;
flip "%{$fg[yellow]%}%? %{$fg[red]%}(╯°□°)╯︵ ┻━┻%{$reset_color%}"
upright "%{$fg[yellow]%}┳━┳ ~ ◞(◦_◦◞)%{$reset_color%}"
vtsatskin / gist:2f2aa13d236ebe2d17a5
Last active Aug 29, 2015
Reading Analog pins on Arduino and streaming over serial USB
View gist:2f2aa13d236ebe2d17a5
void setup(void) {
Serial.println("Setup happened: serial initiated");
void loop() {
int pin0 = analogRead(A0);
vtsatskin /
Created Jul 14, 2015
Connecting a router to the uWaterloo network

Router Setup at uWaterloo

This guide assumes you are using a router with DD-WRT. Other routers may work if they support MAC Address cloning/spoofing.

Obtain a MAC Address of a school computer

  1. Log onto a school computer
  2. Type ipconfig /all into the command line
  • Example output:
You can’t perform that action at this time.