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 android.content.Context | |
| import android.graphics.drawable.Drawable | |
| import android.graphics.drawable.ShapeDrawable | |
| import android.graphics.drawable.shapes.RectShape | |
| import android.support.v4.content.ContextCompat | |
| import android.support.v4.widget.NestedScrollView | |
| import android.text.method.ScrollingMovementMethod | |
| import android.view.Gravity |
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
| /* | |
| * Prints the items in the list with delay | |
| */ | |
| StreamSubscription<String> timerSubscription; | |
| List<String> iterable = ["2", "1", "x"]; | |
| timerSubscription = Observable.fromIterable(timerText).concatMap((i) { | |
| return new Observable.timer(i, Duration(seconds: 1)); | |
| }).listen((x) { | |
| print(x); //Prints "2" , 1 sec later then prints "1", 1 sec later prints "x" | |
| if (x == iterable[0]) { |
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
| Loading image with updates | |
| - takes more process/memory than regular image loading in flutter | |
| - advantage: sure that the image is updated properly | |
| 1. load image from /data/picture1.jpg (1001 bytes) | |
| 2. replace image but retain same name /data/picture1.png (850 bytes) | |
| * normal loading will not update the image, using the below code the change in image gets reflected | |
| ClipRRect( | |
| borderRadius: BorderRadius.circular(16.0), | |
| child: Image.memory( | |
| Uint8List.fromList( |
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
| find . -name "*textToSearch*" -print | |
| find . -iname "*textToSearch*" -print (case insensitive) | |
| --recursive search for a file in directory that contains 'textToSearch' in file name | |
| find . -maxdepth 1 -name "*textToSearch*" -print | |
| -- -maxdepth 1 - means search only in current directory, not subdirectories | |
| -- https://stackoverflow.com/questions/11328988/find-all-files-with-name-containing-string | |
| find libdir -name "*.jar" -exec zipgrep "TEXTTOFINDINSIDEJAR" '{}' \; | |
| find . -name "*.jar" -exec zipgrep "TEXTTOFINDINSIDEJAR" '{}' \; |
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
| #PYTHON FILTER String LIST VIA LAMBDA | |
| list = ["Main.py", "util.py", "Test.py", "Main.java", "Util.java", "Test.java"] | |
| #GET ALL FILES ENDING WITH .py | |
| allpythonfiles = filter(lambda x: x.endswith(".py"), allfiles) | |
| #GET ALL FILES ENDING WITH .java | |
| allpythonfiles = filter(lambda x: x.endswith(".java"), allfiles) | |
OlderNewer