Skip to content

Instantly share code, notes, and snippets.

View wangyung's full-sized avatar

Freddie Wang wangyung

View GitHub Profile
@wangyung
wangyung / swap_overlay.kt
Created February 24, 2020 01:32
The example of how to animate tile overlay and decrease the flickers
private fun swapTiles() {
if (overlay1 != null) {
overlay2 = map.addTileOverlay(
TileOverlayOptions()
.tileProvider(timedTileProvider)
.fadeIn(false)
.zIndex(zIndex)
)
removeOverlay(overlay1) {
overlay1 = null
@wangyung
wangyung / animate_overlay.kt
Last active February 24, 2020 01:31
The example of how to animate the tile overlay on google maps
fun animateTileOverlay() {
overlay?.remove() // Remove previous overlay
overlay = map.addTileOverlay(
TileOverlayOptions()
.tileProvider(tileProvider)
.fadeIn(false)
.zIndex(zIndex)
)
}
@wangyung
wangyung / scan_all_files.kt #for_medium
Last active September 14, 2020 15:41
Pseudo code for scanning all files and get the cover image.
private fun scanDirectory(directory: Path) {
Files
.walk(directory)
.filter {
Files.isDirectory(it, LinkOption.NOFOLLOW_LINKS)
}.forEach {
scope.launch { readBooksFromPath(it) }
}
}
@wangyung
wangyung / description.md
Created May 6, 2019 10:35 — forked from dmytrodanylyk/description.md
Where this dependency comes from?

Did you ever have android build failed​ issue because of dependency resolution?

… or you were curious where all these old rxjava dependencies come from?

You can pretty easy track the module causing issues via following gradle command.

gradlew :root-module:dependencyInsight \
--configuration debugRuntimeClasspath \ // or debugCompileClasspath
--dependency io.reactivex:rxjava:1.1.0 > dependencies.txt // saves result to 'dependencies.txt' file
@wangyung
wangyung / adb_tips.sh
Created April 23, 2019 06:45
adb tips
# Launch developer options.
adb shell am start -a android.settings.APPLICATION_DEVELOPMENT_SETTINGS
@wangyung
wangyung / keybase.md
Created January 29, 2018 03:13
for keybase

Keybase proof

I hereby claim:

  • I am wangyung on github.
  • I am wangyung (https://keybase.io/wangyung) on keybase.
  • I have a public key ASA2q2N6lgS50GIUEpSsBaRs_684iOmm-gZRXkxkX45Ddwo

To claim this, I am signing this object:

@wangyung
wangyung / _ConstraintLayout.kt
Created August 9, 2017 03:45 — forked from anonymous/_ConstraintLayout.kt
Anko ConstraintLayout
import android.app.Activity
import android.content.Context
import android.support.constraint.ConstraintLayout
import android.util.AttributeSet
import android.view.View
import android.view.ViewGroup
import android.view.ViewManager
import org.jetbrains.anko.AnkoViewDslMarker
import org.jetbrains.anko.custom.ankoView
@wangyung
wangyung / deploy.gradle
Last active June 15, 2017 03:38
Deploy the artifact to local directory
publishing {
publications {
maven(MavenPublication) {
groupId 'THE_GROUP_ID'
artifactId project.name
version android.defaultConfig.versionName
artifact source: file("${project.buildDir}/outputs/aar/${project.name}-release.aar")
}
}
repositories {
@wangyung
wangyung / gist:3c50a9bc32f63c10b0421f5e045f16d7
Last active September 18, 2020 17:32
windows tips #tips #windows
  1. Fix the hidden attribue can't be changed in files
    attrib -s -h file1, file2 …

  2. Recovery "show desktop" command

#Edit Desktop.scf with
[Shell]
Command=2
IconFile=explorer.exe,3
[Taskbar]
@wangyung
wangyung / mactips.sh
Last active September 14, 2020 15:41
some mac os tips #mac #tips
#1. Show hidden files in Finder
defaults write com.apple.finder AppleShowAllFiles -bool true
killall Finder
#2. Show full path in Finder
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
#3. Cancel the auto backup in iTunes
defaults write com.apple.iTunes DeviceBackupsDisabled -bool true