Skip to content

Instantly share code, notes, and snippets.

@daohoangson
daohoangson / main.dart
Created May 28, 2022
Nested HTML table in Flutter.
View main.dart
import 'package:flutter/material.dart';
import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
@daohoangson
daohoangson / Main.java
Created Apr 20, 2022
HMAC / SHA256 in different languagues
View Main.java
import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.util.Base64;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
class Main {
public static String encode(String data, String key) throws InvalidKeyException, NoSuchAlgorithmException, UnsupportedEncodingException {
Mac sha256 = Mac.getInstance("HmacSHA256");
@daohoangson
daohoangson / main.dart
Created Mar 22, 2022
Flutter CameraPreview in ClipRRect example
View main.dart
import 'package:flutter/material.dart';
import 'package:camera/camera.dart';
void main() => runApp(const CameraApp());
class CameraApp extends StatefulWidget {
const CameraApp({Key? key}) : super(key: key);
@override
_CameraAppState createState() => _CameraAppState();
View main.dart
import 'package:flutter/material.dart';
import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@daohoangson
daohoangson / main.dart
Created Nov 18, 2021
`HtmlWidget.customWidgetBuilder` example
View main.dart
import 'package:carousel_slider/carousel_slider.dart';
import 'package:flutter/material.dart';
import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
@daohoangson
daohoangson / main.dart
Created Nov 17, 2021
`HtmlWidget.customStylesBuilder` example
View main.dart
import 'package:flutter/material.dart';
import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
@daohoangson
daohoangson / main.dart
Created Aug 23, 2021
`Paragraph.getBoxesForPlaceholders` returns NaN when font size is zero. Reference: https://github.com/daohoangson/flutter_widget_from_html/issues/578
View main.dart
import 'package:flutter/material.dart';
void main() => runApp(MaterialApp(
home: Scaffold(
body: Center(
child: MyWidget(),
),
),
));
@daohoangson
daohoangson / mexico-out.csv
Last active May 23, 2021
Executing `npm start -- --export mexico` with https://github.com/daohoangson/js-fta-crawler/
View mexico-out.csv
We can't make this file beautiful and searchable because it's too large.
Mã,Hiệp định,Thuế suất cơ sở,Thuế suất ưu đãi hiện hành,Thuế suất ưu đãi vào cuối lộ trình,Lộ trình,2019-01-14,2020-01-01,2021-01-01,2022-01-01,2023-01-01,2024-01-01,2025-01-01,2026-01-01,2027-01-01,2028-01-01,2029-01-01,2030-01-01,2031-01-01,2032-01-01,2033-01-01,2034-01-01
01012101,CPTPP,10%,0%,0%,EIF,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%
01012901,CPTPP,20%,0%,0%,EIF,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%
01012902,CPTPP,10%,0%,0%,EIF,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%
01012903,CPTPP,10%,0%,0%,EIF,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%
01012999,CPTPP,20%,0%,0%,EIF,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%
01013001,CPTPP,20%,0%,0%,EIF,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%
01019099,CPTPP,20%,0%,0%,EIF,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%
01022101,CPTPP,Free,0%,0%,EIF,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%
View daohoangson-2020.glb
glTF< JSON{"scenes":[{"nodes":[0]}],"nodes":[{"mesh":0,"rotation":[-0.70710678119,0,0,0.70710678119]}],"meshes":[{"primitives":[{"attributes":{"POSITION":1},"indices":0,"material":0}]}],"buffers":[{"byteLength":0}],"bufferViews":[{"buffer":0,"byteOffset":0,"byteLength":0,"target":34963},{"buffer":0,"byteOffset":0,"byteLength":0,"target":34962}],"accessors":[{"bufferView":0,"byteOffset":0,"componentType":5125,"count":0,"type":"SCALAR","max":[-1],"min":[0]},{"bufferView":1,"byteOffset":0,"componentType":5126,"count":0,"type":"VEC3","min":[999999,999999,999999],"max":[-999999,-999999,-999999]}],"asset":{"version":"2.0","generator":"STL2GLTF"},"materials":[{"pbrMetallicRoughness":{"baseColorFactor":[0.5882352941176471,0.5882352941176471,0.5882352941176471,1],"metallicFactor":1,"roughnessFactor":1}}]} BIN
@daohoangson
daohoangson / main.dart
Created Jan 27, 2021
Flutter demo with TextPainter and PageView
View main.dart
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'alice_in_wonderland.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {