Skip to content

Instantly share code, notes, and snippets.

View hilfritz's full-sized avatar

Hilfritz hilfritz

View GitHub Profile
@hilfritz
hilfritz / gist:af0f54bc8a38503a1626ad60946a4ec1
Last active October 31, 2022 08:46
EditTextViewUtil - util to make edittext look like textview
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
@hilfritz
hilfritz / RXDart
Last active October 10, 2019 04:37
Dart Flutter
/*
* 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]) {
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(
@hilfritz
hilfritz / Linux commands
Last active February 8, 2022 04:23
Linux commands
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" '{}' \;
@hilfritz
hilfritz / Python Stuff
Created December 5, 2021 13:42
Python Stuff
#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)