Skip to content

Instantly share code, notes, and snippets.

View kabbi's full-sized avatar

Dmitry Kabak kabbi

View GitHub Profile
@kabbi
kabbi / gist:5815732
Last active December 18, 2015 16:59
Inferno's native 'array of array of someAdt' example.
ar = H2D(Array*, heaparray(&Tptr, nimports));
ai = (Array**)ar->data;
for(i2 = m->ldt; *i2 != nil; i2++){
nimports = 0;
for(i1 = *i2; i1->name != nil; i1++)
nimports++;
*ai = H2D(Array*, heaparray(Timport, nimports));
li = (Loader_Import*)(*ai)->data;
@kabbi
kabbi / limbo.html
Created March 3, 2014 17:27
limbo pygments showcase
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=latin1">
<style type="text/css">
td.linenos { background-color: #f0f0f0; padding-right: 10px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
@kabbi
kabbi / cheshire.md
Created September 23, 2014 17:45
An attempt to make some written reborn-cheshire specification

Cheshire

I want cheshire to be my own mega-application. Incorporating all the great ideas and things I imagine. To be distributed platform, wonderland container, personal helper, and enormous number of other things.

Main application

Cheshire itself is currently written in CoffeeScript. It's supposed to be run by node's coffee command, so there is no any build system or js equivalent of coffee code.

'use strict';
const from = require('from2');
class StdoutNode {
constructor(id) {
this.id = id;
}
getInputs() {
return [{
id: 'stdout',
@kabbi
kabbi / keybase.md
Created August 17, 2016 15:04
Keybase proof of identity

Keybase proof

I hereby claim:

  • I am kabbi on github.
  • I am kabbi (https://keybase.io/kabbi) on keybase.
  • I have a public key ASDcigWFJRfV-IgpRkzmmFUy8_c0V6jYEqMwmzIZD_6c1Qo

To claim this, I am signing this object:

import { createStore } from 'redux';
import { actions, combineForms } from 'react-redux-form';
const store = createStore(combineForms({
user: {
city: null,
},
}));
console.log('Initial state:', store.getState());
import { createStore, applyMiddleware } from 'redux';
import { actions, combineForms, getField } from 'react-redux-form';
import thunk from 'redux-thunk';
const formsReducer = combineForms({
user: { arr: [] },
});
const store = createStore(formsReducer, applyMiddleware(thunk));
// COMMON SETTINGS
// ----------------------------------------------------------------------------------------------
// These settings are used in both SW UART, HW UART and SPI mode
// ----------------------------------------------------------------------------------------------
#define BUFSIZE 100 // Size of the read buffer for incoming data
#define BLEBUFSIZE 300 // Size of the read buffer for incoming data
#define VERBOSE_MODE true // If set to 'true' enables debug output
// SOFTWARE UART SETTINGS
@kabbi
kabbi / ota.ino
Created October 25, 2018 18:29
Base ArduinoOTA + WifiManager for esp8266
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h>
#include <ArduinoOTA.h>
#include <WebSocketsClient.h>
#include <DNSServer.h>
void setup() {
Serial.begin(115200);
@kabbi
kabbi / uwatch2-protocol.md
Last active March 13, 2020 12:11
Umidigy uwatch2 ble protocol reverse engineering notes

Packet format

0xfe - start byte
0xea - some kind of protocol version
0x10 - some kind of protocol version
1 byte of packet length, payload length + 4
variable length payload