Skip to content

Instantly share code, notes, and snippets.

View FTKhanFT's full-sized avatar
🌏
Working for the community

Tanvir Ahmed Khan FTKhanFT

🌏
Working for the community
View GitHub Profile
@FTKhanFT
FTKhanFT / cache_x_example.dart
Last active February 5, 2021 23:30
How to use cache_x package from the Example project
import 'package:cache_x/cache_x.dart';
import 'package:flutter/material.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
// Initialize password
// Password length must be 128/192/256 bits
// You can use the password of 16 character,24 character or 32 character.
String password = 'CBoaDQIQAgceGg8dFAkMDBEOECEZCxg=';
@SteveAlexander
SteveAlexander / weighted_shuffle.dart
Last active June 18, 2022 17:56
Weighted shuffle in Dart
import 'dart:math' show Random, pow;
List<T> weightedShuffle<T>(List<T> items, List<num> weights, [Random rng]) {
// See https://softwareengineering.stackexchange.com/questions/233541/how-to-implement-a-weighted-shuffle
// and http://utopia.duth.gr/~pefraimi/research/data/2007EncOfAlg.pdf
assert(items.length == weights.length);
if (rng == null) rng = Random();
final List<double> values = weights
.map<double>((weight) => -pow(rng.nextDouble(), 1 / weight))
.toList(growable: false);
Serial Keys:
FU512-2DG1H-M85QZ-U7Z5T-PY8ZD
CU3MA-2LG1N-48EGQ-9GNGZ-QG0UD
GV7N2-DQZ00-4897Y-27ZNX-NV0TD
YZ718-4REEQ-08DHQ-JNYQC-ZQRD0
GZ3N0-6CX0L-H80UP-FPM59-NKAD4
YY31H-6EYEJ-480VZ-VXXZC-QF2E0
ZG51K-25FE1-H81ZP-95XGT-WV2C0
VG30H-2AX11-H88FQ-CQXGZ-M6AY4
@FTKhanFT
FTKhanFT / setup.sh
Created October 13, 2019 12:04 — forked from jjvillavicencio/setup.sh
Install Android SDK on Windows Bash (WSL)
cd /home/<user>/
sudo apt-get install unzip
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
unzip sdk-tools-linux-4333796.zip -d Android
rm sdk-tools-linux-4333796.zip
sudo apt-get install -y lib32z1 openjdk-8-jdk
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=$PATH:$JAVA_HOME/bin
printf "\n\nexport JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64\nexport PATH=\$PATH:\$JAVA_HOME/bin" >> ~/.bashrc
cd Android/tools/bin