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
# Optimize mp4 | |
# Usage: optimizeVideo video_file | |
optimizeVideo() { | |
ffmpeg -i "${1}" -vcodec h264 -acodec mp2 "${1}".mp4 | |
} |
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
# Convert video to gif file. | |
# Usage: video2gif video_file (scale) (fps) | |
video2gif() { | |
ffmpeg -y -i "${1}" -vf fps=${3:-10},scale=${2:-320}:-1:flags=lanczos,palettegen "${1}.png" | |
ffmpeg -i "${1}" -i "${1}.png" -filter_complex "fps=${3:-10},scale=${2:-320}:-1:flags=lanczos[x];[x][1:v]paletteuse" "${1}".gif | |
rm "${1}.png" | |
} |
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
# Function | |
function showLogs { | |
git log --pretty=format:'- %s' --since="$1" --author="$2" | |
} | |
# Convert video to gif file. | |
# Usage: video2gif video_file (scale) (fps) | |
video2gif() { | |
ffmpeg -y -i "${1}" -vf fps=${3:-10},scale=${2:-320}:-1:flags=lanczos,palettegen "${1}.png" | |
ffmpeg -i "${1}" -i "${1}.png" -filter_complex "fps=${3:-10},scale=${2:-320}:-1:flags=lanczos[x];[x][1:v]paletteuse" "${1}".gif |
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
@InstallIn(SingletonComponent::class) | |
@Module | |
abstract class MyModule { | |
@Singleton | |
@Binds | |
abstract fun bindingFunction(myImpl: MyInterfaceImpl) : MyInterface | |
} |
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
@Module | |
@InstallIn(SingletonComponent::class) | |
object NetworkModule { | |
@Provides | |
@Singleton | |
fun provideRetrofit(): Retrofit { | |
return Retrofit.Builder() | |
.baseUrl("https://sample.com") | |
.build() | |
} |
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
@Module | |
@InstallIn(SingletonComponent::class) | |
object NetworkModule { | |
@Provides | |
fun provideRetrofit(): Retrofit { | |
return Retrofit.Builder() | |
.baseUrl("https://sample.com") | |
.build() | |
} | |
} |
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
@Singleton | |
class MyCustomManager @Inject constructor() { | |
// 省略內容 | |
} |
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
class MyCustomManager @Inject constructor() { | |
// 省略內容 | |
} |
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
let mapleader = "\<space>" | |
" set clipboard=unnamed | |
" set clipboard=unnamedplus | |
" set clipboard=unnamed,unnamedplus | |
" Plugins | |
set highlightedyank | |
set NERDTree | |
set surround |
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
override fun onCreate(savedInstanceStates: Bundle?) { | |
viewModel.viewEffectPublisher.observe(this, Observer<Event<ViewEffect>> { event -> | |
event.getContentIfNotHandled()?.let { | |
handleViewEffects(it) | |
} | |
}) | |
} | |
private fun handleViewEffects(viewEffect: ViewEffect) { | |
when (viewEffect) { |