Skip to content

Instantly share code, notes, and snippets.

@vtsatskin
vtsatskin / gist:499c6315be556dcc4fbc
Last active August 29, 2015 14:03
HTN invite function signatures
createTeam(email_hash, token, callback)
* Only error: token is invalid
* callback(err, teamCode)
addToTeam(email_hash, team_id, token, callback)
* Only error: any one of the variables fucked up
* callback(err)
deleteFromTeam(email_hash, team_id, token, callback)
* Only error: any one of the variables fucked up
redis-server &
coffee -cw public/scripts &
sass --watch public/styles --style compressed &
coffee app.coffee
@vtsatskin
vtsatskin / failing.txt
Created October 30, 2014 22:23
Failing vs working file structures for gulp-gh-pages issue #26
.
├── gh-pages
│   ├── css
│   │   ├── mozdoc
│   │   │   ├── octicons
│   │   │   │   ├── LICENSE.txt
│   │   │   │   ├── octicons.css
│   │   │   │   ├── octicons.eot
│   │   │   │   ├── octicons.svg
│   │   │   │   ├── octicons.ttf
@vtsatskin
vtsatskin / circle.yml
Created June 21, 2015 03:25
Deploying wbkd/react-starterkit to gh-pages
general:
branches:
ignore:
- gh-pages
dependencies:
override:
- npm install
- bower install
test:
override:
@vtsatskin
vtsatskin / setup.md
Created July 14, 2015 18:56
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:
@vtsatskin
vtsatskin / gist:2f2aa13d236ebe2d17a5
Last active August 29, 2015 14:25
Reading Analog pins on Arduino and streaming over serial USB
void setup(void) {
Serial.begin(9600);
Serial.println("Setup happened: serial initiated");
}
void loop() {
int pin0 = analogRead(A0);
Serial.println(pin0);
delay(125);
}
@vtsatskin
vtsatskin / tableFlip.theme
Last active August 29, 2015 14:25 — forked from dhuynh/tableFlip.theme
Table Flip oh-my-zsh 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;
table=(
flip "%{$fg[yellow]%}%? %{$fg[red]%}(╯°□°)╯︵ ┻━┻%{$reset_color%}"
upright "%{$fg[yellow]%}┳━┳ ~ ◞(◦_◦◞)%{$reset_color%}"
@vtsatskin
vtsatskin / tkinter_key_event_debouncing.py
Created October 13, 2015 17:32
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
vtsatskin / frames_to_video.py
Created October 23, 2015 20:22
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 = cv2.cv.CV_FOURCC(*codec)
out = cv2.VideoWriter(file_path, fourcc, fps, (width,height))
for frame in frames:
out.write(frame)

Keybase proof

I hereby claim:

  • I am vtsatskin on github.
  • I am vtask (https://keybase.io/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: