Skip to content

Instantly share code, notes, and snippets.

View malcom's full-sized avatar

Marcin Malich malcom

View GitHub Profile
@malcom
malcom / avr.cpp
Created April 30, 2017 21:27
Binary to BCD conversion algorithms (benchmark on AVR)
//
// Simple binary to BCD conversion algorithms
// http://blog.malcom.pl/2017/konwersja-liczb-binarnych-do-kodu-bcd-avr.html
//
// Copyright (C) 2017 Marcin 'Malcom' Malich <me@malcom.pl>
// Released under the MIT License.
//
// This file contains simple benhmark for AVR microcontrollers
//
@malcom
malcom / multiplex-inter-loop.cpp
Last active March 20, 2017 01:27
Sample multiplexing 7-segment LED displays on AVR
//
// Sample multiplexing 7-segment LED displays on AVR
// http://blog.malcom.pl/2017/o-multipleksowaniu-wyswietlaczy-led.html
//
// Copyright (C) 2017 Marcin 'Malcom' Malich <me@malcom.pl>
//
#include <inttypes.h>
#include <stdio.h> // size_t
@malcom
malcom / QTestSuite.h
Last active December 26, 2015 01:29
QTestSuite - Simple tool for organising your test cases and test suites into hierarchy.
// QTestSuite
// Simple tool for organising your test cases and test suites into hierarchy.
// Marcin 'Malcom' Malich <me@malcom.pl>
// http://blog.malcom.pl/2013/10/20/qtestsuite/
// MIT License
#ifndef QTEST_SUITE_H
#define QTEST_SUITE_H
#include <QTest>
@malcom
malcom / example.cpp
Last active December 18, 2015 09:09
TestBenchmark
// Test::Benchmark example
// http://gist.github.com/malcom/5759223
#include "testbenchm.hpp"
#include <iostream>
#include <iomanip>
#include <memory>
#include <random>
#include <algorithm> // std::generate_n
@malcom
malcom / limiter.h
Last active December 16, 2015 11:09
ops limiter
//
// working concept of ops limiter
//
// http://blog.malcom.pl/2013/04/20/limitowanie-ops/
//
// MIT license
//
#ifndef LOPS_LIMITER_H
#define LOPS_LIMITER_H
@malcom
malcom / wp-mc.php
Created September 17, 2009 19:23
WP Math Captcha
<?php
/*
Plugin Name: WP Math Captcha
Plugin URI: http://projects.malcom.pl/plugins/wordpress/wp-mc.xhtml
Description: Simple math captcha for wordpress comments.
Version: 0.3
Author: Marcin 'Malcom' Malich
Author URI: http://malcom.pl
*/
/*
* TreeLinkedList - simple tree structure with lists, simlar to B-tree
* http://projects.malcom.pl/code/treelist.xhtml
*
* Copyright (C) 2009 Marcin 'Malcom' Malich <me@malcom.pl>
*
* Released under the MIT License.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
/*
* Matrix - simple two-dimensional dynamic array based of std::vector
* http://projects.malcom.pl/code/matrix.xhtml
*
* Copyright (C) 2009, 2010 Marcin 'Malcom' Malich <me@malcom.pl>
*
* Released under the MIT License.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
/*
* VectorPtr - Thin Template idiom for the vector of pointers
* http://projects.malcom.pl/code/vector_ptr.xhtml
*
* Copyright (C) 2009 Marcin 'Malcom' Malich <me@malcom.pl>
*
* Released under the MIT License.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal