Skip to content

Instantly share code, notes, and snippets.

View MilanLempera's full-sized avatar

Milan Lempera MilanLempera

View GitHub Profile
const { log } = actions;
const START_CHAR = '-';
const END_CHAR = '-';
const CONTROL_SEQUENCE_COUNT = 3;
const CONTROL_SEQUENCE_TIMEOUT = 200;
const DATA_TIMEOUT = 2000;
const scannerMachine = Machine({
id: 'scannerMachine',
@MilanLempera
MilanLempera / machine.js
Last active February 11, 2020 21:50
Generated by XState Viz: https://xstate.js.org/viz
const START_CHAR = '-';
const END_CHAR = '-';
const CONTROL_SEQUENCE_COUNT = 3;
const CONTROL_SEQUENCE_TIMEOUT = 500;
const DATA_TIMEOUT = 2000;
const scannerMachine = Machine(
@MilanLempera
MilanLempera / machine.js
Last active January 23, 2020 14:48
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
@MilanLempera
MilanLempera / launch.json
Created March 1, 2016 06:24
visual studio code - jasmine debug
{
"version": "0.2.0",
"configurations": [
{
"name": "Run jasmine",
"type": "node",
"program": "${workspaceRoot}/node_modules/jasmine/bin/jasmine.js",
"stopOnEntry": false,
"args": [],
"cwd": "${workspaceRoot}",
@MilanLempera
MilanLempera / dateinterval-bug.php
Last active December 31, 2015 10:49
php dateinterval comparation bug
<?php
function printComparationResults($interval, $intervalWeek) {
if ($interval < $intervalWeek ) {
echo "interval is smaller\n";
}
if ($interval == $intervalWeek ) {
echo "intervals are equals\n";
}
<?php
class SomeService {
/**
* @param array $saveResult výsledky uložení souborů
* @param array $savedFiles
* @param array $missedFiles
*/
private function _processDataSaveResult($saveResult, &$savedFiles, &$missedFiles) {