Skip to content

Instantly share code, notes, and snippets.

Konstantin Kirik snegovick

Block or report user

Report or block snegovick

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
View camera_source
#!/usr/bin/env python
# Copyright (C) 2012 by Kirik Konstantin <snegovick>
import pygst
import Image
pygst.require("0.10")
import gst
import sys
@snegovick
snegovick / gtkgst_dialog.py
Last active Aug 29, 2015
Example GTK-GST dialog
View gtkgst_dialog.py
try:
import gtk
import gobject
from gtk import gdk
except:
raise SystemExit
import pygtk
if gtk.pygtk_version < (2, 0):
print "PyGtk 2.0 or later required for this widget"
View ssGUI.py
#!/usr/bin/env python
"""
This module sets up a video stream from internal or connected webcam using Gstreamer.
You can then take snapshots.
"""
import pygtk, gtk
import pygst
pygst.require("0.10")
@snegovick
snegovick / ad8495.h
Created Jun 25, 2014
AD8495 ADC values to degrees celsium macros
View ad8495.h
#ifndef __AD8495_H__
#define __AD8495_H__
/* Adjust these values*/
#define VREF 3300 /* Vref input 3.3V */
#define RES_ADC (1<<12) /* ADC resolution 1<<12 stands for 12bit */
/* These values should be ok without tuning */
#define RES_MV 5 /* 5mv / Deg. Celsium */
#define SCALE 100 /* dont use floats, just scale */
@snegovick
snegovick / pmd.sh
Created Oct 2, 2014
Pandoc line to generate russian pdf from md source
View pmd.sh
pandoc --latex-engine=pdflatex -V lang=russian -f markdown $1 -o $2
View drl2ascii.sh
grep ^X $1 | sed -e "s/X//" | sed -e "s/Y/, /" | awk '{printf "%s, %s, 0.0, t\n",NR,$0}' > $1.ascii
@snegovick
snegovick / sutil.lua
Created Sep 10, 2015
Serial utils for lua
View sutil.lua
local sutil = {}
function sutil.getchar(ttyfile)
return ttyfile:read(1)
end
function sutil.readall_timeout(ttyfile, n, time)
local data = ""
local ret = true
local ctr = 0
@snegovick
snegovick / gist:4193874
Created Dec 3, 2012
simple script which reopens same tty
View gist:4193874
import serial
import struct
import sys
import time
def open_and_cat():
port = serial.Serial(sys.argv[1], sys.argv[2], bytesize=8, parity='N', stopbits=1, xonxoff=0, rtscts=0, timeout=2)
while True:
View CC3000_STM32_ChibiOS_Manual_Test.c
/*
* ChibiOS/RT - Copyright (C) 2013 Alan Barr
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
View lpc2468-spi.c
#include <linux/platform_device.h>
#include <linux/of_device.h>
#include <linux/of_gpio.h>
#include <linux/spi/spi.h>
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/clk.h>
#include <linux/io.h>
#include <linux/of.h>
You can’t perform that action at this time.