Skip to content

Instantly share code, notes, and snippets.

View hnvn's full-sized avatar

HungHD hnvn

View GitHub Profile
@slightfoot
slightfoot / single_top.dart
Last active June 19, 2022 11:15
Recreating Android Single-Top Activity behaviour with Flutter Route's - by Simon Lightfoot
// MIT License
//
// Copyright (c) 2019 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@ice09
ice09 / ECRecover.java
Last active May 22, 2022 09:18
Creates a signature from a private key, signs a message and ecrecover in Java. Hashes are equal to Solidity and recoverSigner works with values generated in Java in Solidity ECTools below. Uses web3j.
public class ECRecover {
private void pkDisplay() {
//0x627306090abaB3A6e1400e9345bC60c78a8BEf57
String privateKey1 = "c87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3";
Credentials credentials = Credentials.create(privateKey1);
System.out.println("pk:" + Numeric.toHexStringNoPrefix(credentials.getEcKeyPair().getPublicKey()));
String message = "now that's a text";
String label = "\u0019Ethereum Signed Message:\n"+ String.valueOf(message.getBytes().length) + message;
@gildaswise
gildaswise / rounded_modal.dart
Last active October 7, 2021 09:39
A custom implementation of the showModalBottomSheet, with rounded corners
import 'dart:async';
import 'package:flutter/material.dart';
/// Below is the usage for this function, you'll only have to import this file
/// [radius] takes a double and will be the radius to the rounded corners of this modal
/// [color] will color the modal itself, the default being `Colors.white`
/// [builder] takes the content of the modal, if you're using [Column]
/// or a similar widget, remember to set `mainAxisSize: MainAxisSize.min`
/// so it will only take the needed space.