Skip to content

Instantly share code, notes, and snippets.

View trungungtoan-agilityio's full-sized avatar
🎯
Focusing

trungung trungungtoan-agilityio

🎯
Focusing
  • AgilityIO
View GitHub Profile
@trungungtoan-agilityio
trungungtoan-agilityio / MongoDB cheatsheet.md
Created December 30, 2020 07:31
MongoDB shell commands

~ mongod Start database Server

~ mongo Start database Client

~ net start MongoDB
~ net stop MongoDB

create service

@trungungtoan-agilityio
trungungtoan-agilityio / gist:07737c65eee17bd7cefe54a8ea2c0cbe
Created November 18, 2020 01:50
Deleting Multiple Branches in Git
Open the terminal, or equivalent.
- Type in `git branch | grep "<pattern>"` for a preview of the branches that will be deleted.
- Type in `git branch | grep "<pattern>" | xargs git branch -D`
Replace the <pattern> with a regular expression to match your branch names and that’s it.
class EventAggregator {
companion object {
private var singleton: EventAggregator? = null
fun getInstance(): EventAggregator {
if (singleton == null) {
singleton = EventAggregator()
}
return singleton!!
}
@Composable
fun MyApp() {
MaterialTheme { Counter() }
}
@Composable
fun Counter() {
val amount = +state { 0 }
Column {
@trungungtoan-agilityio
trungungtoan-agilityio / build.gradle
Created January 14, 2020 16:32 — forked from vivekvinodh/build.gradle
Gradle file for gRPC and protobuf v1
apply plugin: 'com.android.application'
apply plugin: 'com.google.protobuf'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
@trungungtoan-agilityio
trungungtoan-agilityio / Espresso_cheat_sheet.txt
Last active January 10, 2020 04:38
Espresso cheat sheet
https://android.github.io/android-test/downloads/espresso-cheat-sheet-2.1.0.pdf
class EventManager {
private constructor() {
}
companion object {
private lateinit var instance: EventManager
val managerInstance: EventManager
get() {
git branch -vv | grep 'origin/.*: gone]' | awk '{print $1}' | xargs git branch -d
@trungungtoan-agilityio
trungungtoan-agilityio / DarkStatusBar.java
Created December 21, 2018 01:55
Apply Hide Soft System navigation bar and dark style
public void hideSystemUI() {
// Set the IMMERSIVE flag.
// Set the content to appear under the system bars so that the content
// doesn't resize when the system bars hide and show.
Window window = getWindow();
if (bgStatusBarView != null) {
window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
}
WindowManager.LayoutParams winParams = window.getAttributes();
winParams.flags &= ~WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
alias gbr="git branch | grep -v "master" | xargs git branch -D"