This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WebSocket _wss; // class level field, so you can use it in methods | |
//method level | |
await WebSocket.connect(uri).timeout((Duration(seconds: 5))).then( | |
(WebSocket ws) { | |
_wss = ws; | |
if (_wss?.readyState == WebSocket.open) { | |
// you can tell server who you are here, right after connecting |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
class Input { | |
var sleepTimes = new List(); | |
} | |
main(List<String> arguments) async { | |
var input = new Input(); | |
arguments.forEach((val) { input.sleepTimes.add(num.parse(val)); } ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name codeFormatter | |
// @homepage https://kmiasko.github.io/ | |
// @version 0.0.2 | |
// @description codeFormatter - umożliwia zachowanie spacji w kodzie oraz koloruje składnię JS na wykop.pl | |
// @author kmiasko | |
// @match https://www.wykop.pl/* | |
// @grant none | |
// @require https://cdn.rawgit.com/kmiasko/highlight.js/master/build/highlight.pack.js | |
// @run-at document-end |