Skip to content

Instantly share code, notes, and snippets.

View kevinmartinjos's full-sized avatar

Kevin Martin Jose kevinmartinjos

View GitHub Profile
@kevinmartinjos
kevinmartinjos / gist:cafc9a7aa9db3f7bfc52
Last active March 30, 2021 22:03
Cohen-Sutherland outcode algorithm
<!--
Cohen-Sutherland outcode algorithm using html5 canvas and javascript. Click to clip lines sequentially
Copyright (C) 2014 Kevin Martin Jose
-->
<!--
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@kevinmartinjos
kevinmartinjos / aubio_mic_pitch
Created October 21, 2014 16:33
Yell at the mic, see the frequencies on the terminal
from aubio import source, pitch, freqtomidi, sink
from pysoundcard import Stream
if __name__ == '__main__':
win_s = 1024 #fft size
hop_s = 512 #hop size. Whatever that means
s = Stream(block_length = hop_s)
@kevinmartinjos
kevinmartinjos / tracker.py
Created May 24, 2014 17:13
Tracks the color red. Crude and ineffective. LOT of room for improvement
import cv2,math
import time
import numpy as np
from pymouse import PyMouse
class ColourTracker:
def __init__(self):
cv2.namedWindow("colourTrackerWindow",cv2.CV_WINDOW_AUTOSIZE)
cv2.namedWindow("alternateWindow",cv2.CV_WINDOW_AUTOSIZE)
self.capture=cv2.VideoCapture(1)
self.scale_down=1
@kevinmartinjos
kevinmartinjos / mlpython.c
Last active August 29, 2015 14:00
Program using libvarnam that transliterates string literals
/*
Usage : ./a.out <pythonfile>
The transliterated file will be saved as original filename + ml.py
Remember to place the file in the examples subdir in the libvarnam codebase
wont work for multiple literals in the same line
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>