Skip to content

Instantly share code, notes, and snippets.

View sewerk's full-sized avatar

Kamil Seweryn sewerk

View GitHub Profile
@sewerk
sewerk / find_grep.sh
Last active June 30, 2021 15:22
Finds phrase in file.txt found on current dir - displays filename+line_number+line_content
find . -name "file.txt" -exec grep -n phrase "{$1}" /dev/null \;
// other
grep -or ‘something\|someelse’ —include \*.kt . | sort -u
#!/bin/sh
mogrify -path . -quality 80% -resize 33% $1
#!/bin/sh
convert $1 -strip $1_copy
#!/bin/sh
function merge_2_images() {
convert +append -border 1 -bordercolor "#d3d3d3" $1 $2 merged.png
}
montage -geometry 100% -border 1 $1 $2 merged.png
#!/bin/sh
mogrify -path jpg -format jpg *.png
adb install -r <path>
adb shell pm clear <package>
adb shell input text <text>
adb shell am start -n <package/activity>
adb -d shell pm list packages -f <name>
adb pull <path>
adb shell dd if=/dev/zero of=/sdcard/myfile.dat bs=1024k count=1
1) use deep clean script https://github.com/rock3r/deep-clean
OR
1) close android studio
2) rm -rf ~/.gradle/caches/build-cache-1
3) ./gradlew cleanBuildCache (clears android gradle plugin cache)
4) find . -type d -name "build" -exec rm -rf "{$1}" \;
5) clean build the app
// reveal apk file in folder after release generated
applicationVariants.all { variant ->
variant.assemble.doLast {
//If this is a 'release' build, reveal the compiled apk in finder/explorer
if (variant.buildType.name.contains('release')) {
def path = null;
variant.outputs.each { output ->
path = output.outputFile
}
[user]
email = mail@example.com
name = User Name
[alias]
st = status
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
unwatch = update-index --assume-unchanged
watch = update-index --no-assume-unchanged
@sewerk
sewerk / Live template cheat sheet.md
Last active August 22, 2016 10:54
for Android Studio

standard

  • I or iter or foreach: for each
  • psf: public static final
  • sout: sys.out()
  • serr: sys.err()
  • psvm: main()
  • mx: max()
  • mn: min()
  • lazy: init var
  • inst: instanceof