Skip to content

Instantly share code, notes, and snippets.

View Hecatoncheir's full-sized avatar
:octocat:
Focusing

Vitaliy Vostrikov Hecatoncheir

:octocat:
Focusing
View GitHub Profile
@Hecatoncheir
Hecatoncheir / test
Last active January 15, 2018 13:11
mqtt subscribe test
test('can subscribe and send events to mq server', () async {
MqttConnectionIOWebSocket connection1 =
new MqttConnectionIOWebSocket.setOptions(host: mqIp);
MqttClient<MqttConnectionIOWebSocket> client1 =
new MqttClient<MqttConnectionIOWebSocket>(connection1,
clientID: 'FirstClient',
qos: QOS_1,
userName: login,
userPassword: password);
main.dart.js:10583 EXCEPTION: NullError: method not found: 'appendChild' on null
STACKTRACE:
TypeError: Cannot read property 'appendChild' of null
at EN.$0 (http://localhost:63342/web_lko/build/web/main.dart.js:9422:3)
at EU.dart.EU.$0 (http://localhost:63342/web_lko/build/web/main.dart.js:9393:14)
at N7.dart.x3.func (http://localhost:63342/web_lko/build/web/main.dart.js:3058:35)
at bK.dart.bK.E8 (http://localhost:63342/web_lko/build/web/main.dart.js:10339:7)
at Object.eval (eval at qf (http://localhost:63342/web_lko/build/web/main.dart.js:1851:15), <anonymous>:2:41)
at Qw.aY (http://localhost:63342/web_lko/build/web/main.dart.js:4346:12)
at bK.aY (http://localhost:63342/web_lko/build/web/main.dart.js:10386:30)
// my-tag.dart -----------------------------------------------------------------------
library components;
import 'package:html5/html.dart';
import 'package:polymer_element/polymer_element.dart';
@PolymerRegister('my-tag', template: 'my-tag.html')
abstract class MyTag extends PolymerElement {
@Hecatoncheir
Hecatoncheir / user
Last active October 16, 2017 13:01
vscode
{
"editor.fontFamily": "Cousine, monospace",
"editor.fontSize": 14,
"editor.lineHeight": 24,
"editor.formatOnType": true,
"editor.cursorBlinking": "phase",
"editor.renderIndentGuides": true,
"editor.renderLineHighlight": "all",
"editor.wordWrap": "on",
"editor.tabCompletion": true,
@Hecatoncheir
Hecatoncheir / cockroach
Last active June 13, 2017 17:44
For docker
docker pull cockroachdb/cockroach
docker run -p 8080:8080 -p 26257:26257 cockroachdb/cockroach start --insecure
@Hecatoncheir
Hecatoncheir / example
Last active June 6, 2017 20:27
cayley
package main
import (
"database/sql"
"fmt"
"log"
"regexp"
"strings"
"time"
@Hecatoncheir
Hecatoncheir / gist:f0bb763f5fb96f932189017df3366545
Created April 20, 2017 10:39 — forked from booherbg/gist:f812c9145d157d8945b2
Cross compiling a simple go server for windows

How to build Golang windows/arm static binaries from linux

Alternate title: Cross compiling Windows/Darwin/Linux amd64/386/arm all from linux

After fumbling around trying to figure out the go toolchain and cross compilation configuration, I ran across the wiki page on Go's homepage. It's super helpful, and worked out of the box. I'm including the necessary scripts here in case they get changed or lost, and we can help Google find it (since it's the first real source I've found that "Just Worked"). http://code.google.com/p/go-wiki/wiki/WindowsCrossCompiling

library page_view_component;
import 'dart:async';
import 'dart:html';
import 'package:angular2/angular2.dart';
import 'package:angular2/router.dart';
import 'package:angular2/platform/common.dart';
import 'package:angular2_components/angular2_components.dart';
@Hecatoncheir
Hecatoncheir / event_loop.dart
Created February 20, 2017 13:31 — forked from azenla/event_loop.dart
Simulation of the Dart Event Loop in Dart.
/// Dart is built around a timer, which basically schedules functions in a queue.
/// The Future class is essentially just sugar on top of the event loop.
/// To help people understand what the event loop actually does, I have written code which implements the event loop.
/// See https://www.dartlang.org/articles/event-loop/ for more information.
import "dart:async";
class EventLoop {
/// Function Queue.
static final List<Function> queue = [];
{
"remove-empty-rulesets": true,
"always-semicolon": true,
"color-case": "lower",
"block-indent": " ",
"color-shorthand": true,
"element-case": "lower",
"leading-zero": true,
"sort-order-fallback": "abc",
"space-before-colon": "",