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
#!/bin/bash | |
set -xeo pipefail | |
# https://trac.ffmpeg.org/wiki/Scaling | |
# https://askubuntu.com/questions/506670/how-to-do-i-convert-an-webm-video-to-a-animated-gif-on-the-command-line | |
# https://superuser.com/questions/1049606/reduce-generated-gif-size-using-ffmpeg | |
# https://superuser.com/a/1107201 | |
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
{ | |
"workbench.colorTheme": "Darcula Theme from IntelliJ", | |
"files.autoSave": "afterDelay", | |
"editor.minimap.enabled": false, | |
"editor.renderWhitespace": "all", | |
"editor.codeActionsOnSave": { | |
"source.fixAll": true, | |
"source.organizeImports": true | |
}, | |
"xmlTools.splitAttributesOnFormat": true, |
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
# https://stackoverflow.com/a/36226832 | |
SHELL := env PATH="$(PATH):$(PWD)/bin" /bin/bash | |
# Define environment variables | |
ENV_FILES := $(wildcard .env.default .env) | |
ifneq ($(ENV_FILES),) | |
include $(ENV_FILES) | |
export $(shell grep -he '^[^\#;]' $(ENV_FILES) | sed 's/=.*//' | sort | uniq) | |
endif |
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
main() { | |
check_args | |
resize_android | |
resize_ios | |
} | |
resize_android() { | |
if [[ -z "$ANDROID_FILE_NAME" ]]; then | |
return | |
fi |
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.app.Activity | |
fun <T> Activity.argument(key: String, default: T? = null) = | |
argument(key) { default } | |
fun <T> Activity.argument(key: String, default: () -> T? = { null }) = lazy { | |
intent.extras?.getValueOrDefault(key, default) | |
} |
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
wget -qO- https://url.to/file.zip | jar xvf /dev/stdin |
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
$ ^Z # (CTRL+Z) stop job | |
$ bg # continue job in background | |
$ jobs # show all running jobs | |
$ disown -h %1 # keep job #1 running when exit terminal | |
$ disown -a # keep all jobs running when exit terminal |
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 androidx.appcompat.app.AppCompatActivity | |
import android.os.Bundle | |
import android.os.Build | |
import android.annotation.TargetApi | |
import android.content.Context | |
import java.util.* | |
class BaseActivity : AppCompatActivity() { |
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 java.util.* | |
fun Date.formatElapsedTime(context: Context, to: Calendar) = | |
when (val elapsedDays = elapsedDays(to)) { | |
0 -> { | |
val elapsedHours = elapsedHours(to) | |
val elapsedMinutes = elapsedMinutes(to) | |
when { |
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
# This file has been auto-generated by i3-config-wizard(1). | |
# It will not be overwritten, so edit it as you like. | |
# | |
# Should you change your keyboard layout some time, delete | |
# this file and re-run i3-config-wizard(1). | |
# | |
# i3 config file (v4) | |
# | |
# Please see https://i3wm.org/docs/userguide.html for a complete reference! |
NewerOlder