Skip to content

Instantly share code, notes, and snippets.

@byxor
byxor / keyframes.py
Last active November 28, 2018 06:39
Quickly extract N keyframes from a video (requires python2 and opencv)
from __future__ import division
import sys
import cv2
import contextlib
def main(num_keyframes, filepath):
print("Extracting {} keyframes from '{}'...".format(num_keyframes, filepath))
with video_file(filepath) as video:
@byxor
byxor / foo.js
Last active November 27, 2017 16:26
new Audio("http://hcmaslov.d-real.sci-nnov.ru/public/mp3/Beatles/11%20Yellow%20Submarine/The%20Beatles%20-%20Yellow%20Submarine%20-%2001%20Yellow%20Submarine.mp3").play();alert("done");
@byxor
byxor / SETUP.sh
Last active January 3, 2019 00:49
Sets up my linux distribution quickly. May require tweaking.
INITIAL_DIRECTORY=$pwd
function write {
local block="################################################"
echo
echo $block
echo [$1]
echo $block
pause
}
Write a python program called p0.py that takes two positive integers and outputs their product.
Sample input:
1
2
Sample output:
2
You can run it like this:
.586
.model flat,stdcall
.stack 4096
option casemap:none
include p:\masm32\include\windows.inc
include p:\masm32\include\kernel32.inc
include p:\masm32\include\user32.inc
include p:\masm32\include\msvcrt.inc
include p:\masm32\include\ca296.inc
@byxor
byxor / ASM_Junk.md
Created January 11, 2017 19:13
Junk that's relevant to very few people.
  • Convert between binary/decimal using two's complement and hex.
  • Spot what's wrong with this code.
  • LED Exercises (AND/OR/XOR/NAND)
  • Functions with array parameters using the stack.
  • Recursive functions.
  • Reverse Polish Notation (who cares).