Skip to content

Instantly share code, notes, and snippets.

View maly's full-sized avatar

Martin Malý maly

View GitHub Profile
@maly
maly / demo.html
Created September 3, 2013 12:15
"Tweetable" tag pro články
<!doctype html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<link href="//netdna.bootstrapcdn.com/font-awesome/3.1.1/css/font-awesome.css" rel="stylesheet">
<link href="tweetable.css" rel="stylesheet">
</head>
<body>
<p>Blabla bla <tweetable>tohle bude text tweetu</tweetable> bla bla</p>
<p>Blabla bla <tweetable title="tohle bude text tweetu">bla bla bla</tweetable></tweetable> bla bla</p>
@maly
maly / 7seg.html
Created November 17, 2013 18:40
7segment vintage display
<!doctype html>
<html>
<head>
<style>
table.sevenseg{
background-color:#000000;
vertical-align: top;
display:inline-block;
margin:0;
padding:0;
@maly
maly / gist:8068264
Created December 21, 2013 11:39
Generátor disassembleru pro Z80
function toHex2($n) {
$o = dechex($n);
if (strlen($o)<2) $o='0'.$o;
return strtoupper($o);
};
function genrl($code,$ins, $DD, $IX) {
$n = '';
$n .= " case '${DD}CB".toHex2($code+0)."': return '".$ins." ($IX+'+p2+'),B';\n";
$n .= " case '${DD}CB".toHex2($code+1)."': return '".$ins." ($IX+'+p2+'),C';\n";
@maly
maly / i2cbridge.ino
Created December 11, 2016 16:58
Serial to I2C bridge for Arduino Uno
#include <Wire.h>
char inputString[200];
uint8_t ipos = 0;
boolean stringComplete = false;
void setup() {
Serial.begin(9600);
Wire.begin();
ipos = 0;
/*
* Example code showing of to send any datatype - 12 bytes max - (in this example, a struct of
* GPS coordinate) to SigFox network with a SmartEverything prototyping board
* (http://www.smarteverything.it/).
*
* - GPS frame decoding is made with TinyGPS library (https://github.com/mikalhart/TinyGPS).
* - SigFox modem communication is done through direct AT commands. This code is minimalist :
* it doesn't manage downlink messages, and it's error management is sort of non existant.
*
* Why don't I use official SmartEverything libraries (https://github.com/ameltech/) ?
@maly
maly / BlinkRGBStrip
Last active December 21, 2016 18:16
Arduino: Blinking LED Strip
#include "FastLED.h"
// How many leds in your strip?
#define NUM_LEDS 50
// For led chips like Neopixels, which have a data line, ground, and power, you just
// need to define DATA_PIN.
#define DATA_PIN 3
// Define the array of leds
@maly
maly / Environment.js
Last active June 6, 2017 18:10
Lisperator
function Environment(parent) {
this.vars = Object.create(parent ? parent.vars : null);
this.parent = parent;
}
Environment.prototype = {
extend: function() {
return new Environment(this);
},
lookup: function(name) {
var scope = this;
@maly
maly / edushield-sleep.ino
Created May 27, 2017 11:37
Edushield + interrupt + sleep
int RED = A2;
int YELLOW = A3;
int GREEN = 13;
int BUTTON = 2;
#include <avr/sleep.h> // library for sleep
#include <avr/power.h> // library for power control
int currentState = 0;
@maly
maly / mac.emu
Last active September 17, 2017 16:06
SBC Challenge
cpu Z80
memory.ram.from 0x1000
memory.ram.to 0x13ff
memory.rom.from 0x0000
memory.rom.to 0x0fff
;serial simple
;serial.in 1
;serial.out 1
@maly
maly / adent.z80
Created October 2, 2017 17:44
Jednodeskova vyzva 1
.ORG 0
.ENGINE mac
SERIALCTRL = 00h
SERIALDATA = 01h
DI
IM 1
LD sp,ramtop
JR cold