Skip to content

Instantly share code, notes, and snippets.

#include <Arduino.h>
#include "Matrix.h"
Matrix::Matrix(const int *row_pins, const int *column_pins) {
this->row_pins = (int *) row_pins; // FIXME
this->column_pins = (int *) column_pins; // FIXME
for (rows = 0; row_pins[rows] != -1; ++rows) {
pinMode(row_pins[rows], OUTPUT);
import sys
import inspect
import re
def alias(obj) :
rename_regexp = re.compile(r"([a-z0-9])([A-Z])")
make_name = ( lambda name : re.sub(rename_regexp, r"\1_\2", name).lower() )
if inspect.isclass(obj) :
names_list = dir(obj)
for name in names_list :
{
"added": 1388068674.595086,
"cancel": false,
"parents": [],
"splitted": 1388068674.664528,
"tasks": {
"29501016-8d30-4cfc-ac82-48676d199676": {
"created": 1388068674.760826,
"finished": null,
"recycled": 1388068674.760827,
import sys
import json
import pickle
import uuid
import cherrypy
import chrpc.server
from ulib import typetools
from ulib import validators
@mdevaev
mdevaev / gist:030e180e1ba14f871bfd
Created June 25, 2014 15:32
Kazoo test for create()
import kazoo.client
import kazoo.exceptions
from kazoo.protocol.paths import join as zjoin
import threading
import time
# =====
class TimeOf:
def __init__(self, name, print_result=True):
@mdevaev
mdevaev / impfrom.py
Last active August 29, 2015 14:03
Import module from path
import sys
import importlib.abc
# =====
def setup(*args, **kwargs):
finder = _Finder(*args, **kwargs)
sys.meta_path = [finder] + sys.meta_path
return finder
FROM mdevaev/archlinux
MAINTAINER Devaev Maxim <mdevaev@gmail.com>
RUN pacman --noconfirm -Syy \
&& pacman --noconfirm -S \
python-setuptools \
python-mako \
lighttpd \
php \
php-cgi \
from RPi import GPIO
import time
CLOCK_PIN = 4
DATA_PIN = 15
DELAY = 0.00020
def send_bit(bit):
func uint32 main(str[] argv):
keyval<unt32:str> kv;
for uint32 i = 0; i < 10; i++:
kv.append("Number: {}".fmt(i))
for (uint32 k, str v) in kv.items():
print(k, v)
return 0
#include <Arduino.h>
#include <Rotary.h>
// http://techdocs.altium.com/display/FPGA/PS2+Keyboard+Scan+Codes
const int KBD_CLOCK_PIN = A1;
const int KBD_DATA_PIN = A2;
const unsigned char K_PFX = 0xE0;
const unsigned char K_SEP = 0xFF;