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'; | |
const color = [Colors.black, Colors.white]; | |
Widget cR(int iColor, double r, {Widget? child}) => DecoratedBox( | |
decoration: BoxDecoration(color: color[iColor], shape: BoxShape.circle), | |
child: SizedBox.square(dimension: r * 2, child: Center(child: child))); | |
Widget yinYang(double r, [double th = 1.0]) => Padding( | |
padding: const EdgeInsets.all(5), |
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 'dart:math' show pi; | |
import 'package:flutter/material.dart'; | |
Path yinYang(double r, double x, double y, [double th = 1.0]) { | |
cR(double dY, double radius) => Rect.fromCircle(center: Offset(x, y + dY), radius: radius); | |
return Path() | |
..fillType = PathFillType.evenOdd | |
..addOval(cR(0, r + th)) | |
..addOval(cR(r / 2, r / 6)) | |
..addOval(cR(-r / 2, r / 6)) |
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'; | |
void main() => runApp(FittedBox( | |
child: CustomPaint(painter: TreePainter(), size: const Size(2400, 1600)))); | |
class TreePainter extends CustomPainter { | |
@override | |
void paint(Canvas canvas, Size size) { | |
final stroke = Paint() | |
..style = PaintingStyle.stroke |
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
// ==UserScript== | |
// @name Preparing rustdoc for 'Translate Web Pages' add-on | |
// @description Disables translation of navigation sections and entity names (both in text and in search results), as well as source code blocks in rustdoc pages (ex: in doc.rust-lang.org/stable/std/). !!! To translate comments in the code examples and in the code on the [src] pages, you must enable translation for <PRE> tags in "Translate Web Pages" preferences. | |
// @version 1.0.5 | |
// @author vvshard | |
// @grant none | |
// @license MIT | |
// ==/UserScript== | |
if (["rustdoc", "rustdoc-page"].some(clNm => document.body.classList.contains(clNm))){ |