- [Data Structures] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#data-structures)
- [Linked Lists] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#linked-lists)
- [Trees] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#trees)
- [Binary Trees] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#binary-trees)
- [Binary Search Tree] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#binary-search-tree)
- [Red-Black Tree] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#red-black-tree)
- [AVL Tree] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#avl-tree)
- [Tries] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#tries)
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'; | |
| import 'package:flutter/material.dart'; | |
| void main() => runApp(MyApp()); | |
| class MyApp extends StatelessWidget { | |
| // This widget is the root of your application. | |
| @override | |
| Widget build(BuildContext context) { |
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
| Future main() async { | |
| final Iterable<Locale> supportedLocales = [Locale('en'), Locale('ar')]; | |
| await Langs.init(supportedLocales: supportedLocales, loadDeviceLanguage: true); | |
| runApp(MyApp(supportedLocales: supportedLocales)); | |
| print(Langs.string('sample.item.name')); | |
| print(Langs.string('name')); | |
| } |
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 java.io.IOException | |
| import java.util.ArrayList | |
| import com.google.gson.Gson | |
| import com.google.gson.TypeAdapter | |
| import com.google.gson.reflect.TypeToken | |
| import com.google.gson.stream.JsonReader | |
| import com.google.gson.stream.JsonToken | |
| import com.google.gson.stream.JsonWriter |
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
| launch(UI) { | |
| editText.onTextChanged() | |
| .debounce(1, TimeUnit.SECONDS) | |
| .consumeEach { | |
| Log.d("DebounceTest", "value: $it") | |
| } | |
| } | |
| } | |
| fun EditText.onTextChanged(): ReceiveChannel<String> = |
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
| project.afterEvaluate { | |
| android.applicationVariants.all { variant -> | |
| task "installRun${variant.name.capitalize()}"(type: Exec, dependsOn: "install${variant.name.capitalize()}", group: "run") { | |
| commandLine = ["adb", "shell", "monkey", "-p", variant.applicationId + " 1"] | |
| doLast { | |
| println "Launching ${variant.applicationId}" | |
| } | |
| } | |
| } | |
| } |
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
| # install openjdk | |
| sudo apt-get install openjdk-7-jdk | |
| # download android sdk | |
| wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz | |
| tar -xvf android-sdk_r24.2-linux.tgz | |
| cd android-sdk-linux/tools | |
| # install all sdk packages |
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
| //Place this script inside your application module build.gradle | |
| //It will create a new task(s) based on your application variants within (run) group | |
| //sample: ./gradlew installRunDebug | |
| //sample: ./gradlew installRunStagDebug | |
| project.afterEvaluate { | |
| android.applicationVariants.all { variant -> | |
| task "installRun${variant.name.capitalize()}"(type: Exec, dependsOn: "install${variant.name.capitalize()}", group: "run") { | |
| commandLine = ["adb", "shell", "monkey", "-p", variant.applicationId + " 1"] | |
| doLast { |
- Decompile flowup sample app
apktool d flowup.apk -o flowup
- Decompile your apk
apktool d original.apk -o injected
- Copy all the
smalifiles from the flowup library to your decompiled projectcp -r flowup/smali injected/smali_classes{N}where N is the nextsmali_classesgroup number
- Open your app
AndroidManifest.xmland look for theapplicationtag to get itsandroid:namevalue - Open your app main application
.smalifile
#Intro
Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3
Kotlin project website is at kotlin.jetbrains.org.
All the codes here can be copied and run on Kotlin online editor.
Let's get started.
NewerOlder