Skip to content

Instantly share code, notes, and snippets.

View kamikat's full-sized avatar

Kamikat kamikat

View GitHub Profile
@kamikat
kamikat / image64.sh
Last active January 31, 2024 06:08 — forked from puppybits/image64.sh
Create data URI image from Terminal command
#!/bin/sh
# Examples:
# ./image64.sh myImage.png
# outputs: data:image/png;base64,xxxxx
# ./image64.sh myImage.png -img
# outputs: <img src="data:image/png;base64,xxxxx">
append=""
if [[ "$1" == *.gif ]]; then
@kamikat
kamikat / SupportChildFragmentActivityResult.java
Last active August 29, 2015 14:25 — forked from artem-zinnatullin/gist:6916740
Android support library onActivityResult() bug fix for nested fragments
@Override
public void startActivityForResult(Intent intent, int requestCode) {
if (getParentFragment() != null) {
getParentFragment().startActivityForResult(intent, requestCode);
} else {
super.startActivityForResult(intent, requestCode);
}
}