This file contains hidden or 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
| ; ============================================= | |
| ; ----- Move ----- | |
| Space & h:: { | |
| Send "{Blind}{Left}" | |
| } | |
| Space & j:: { | |
| Send "{Blind}{Down}" | |
| } | |
| Space & k:: { | |
| Send "{Blind}{Up}" |
This file contains hidden or 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 'package:flutter/material.dart'; | |
| import 'dart:math'; | |
| class RotatedIcon extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return Transform.rotate( | |
| angle: 90 * pi/180, | |
| child: Icon(Icons.flight), | |
| ); |
This file contains hidden or 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
| Map<String, dynamic> deepMergeMap(Map<String, dynamic> a, Map<String, dynamic> b) { | |
| b.forEach((k, v) { | |
| if (!a.containsKey(k)) { | |
| a[k] = v; | |
| } else { | |
| // TODO handle List type | |
| if (a[k] is Map) { | |
| deepMergeMap(a[k], b[k]); | |
| } else { | |
| a[k] = b[k]; |
This file contains hidden or 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
| from dataclasses import dataclass, fields as datafields | |
| from ujson import dumps, loads | |
| # Note: ujson seamlessly serializes dataclasses, unlike stdlib's json | |
| @dataclass | |
| class Point: | |
| x: float | |
| y: float | |
| # Shallow dataclass can be rebuilt from dict/json: |