Skip to content

Instantly share code, notes, and snippets.

View trietbui85's full-sized avatar

trietbui85 trietbui85

  • Zalora
  • HCMC, Vietnam
  • 05:23 (UTC +07:00)
View GitHub Profile
@tkrotoff
tkrotoff / ReactNative-vs-Flutter.md
Last active February 27, 2024 15:40
React Native vs Flutter

The PATH is an important concept when working on the command line. It's a list of directories that tell your operating system where to look for programs, so that you can just write script instead of /home/me/bin/script or C:\Users\Me\bin\script. But different operating systems have different ways to add a new directory to it:

Windows

  1. The first step depends which version of Windows you're using:
  • If you're using Windows 8 or 10, press the Windows key, then search for and
@vestrel00
vestrel00 / ButterknifeBindingExample.java
Last active June 14, 2018 03:46
B: 2 - Butterknife binding in onViewCreated vs onViewStateRestored
/**
* Logs lifecycle events and provides subclasses a method to bind the views, bindViews().
*
* Note that the bindViews() uses Butterknife to bind the views. However, the views
* can also be bound without using Butterknife. Using Butterknife or not
* plays no part in this demonstration.
*/
// BaseFragment.java
public abstract class BaseFragment extends Fragment {
@Jonalogy
Jonalogy / handling_multiple_github_accounts.md
Last active July 21, 2024 20:48
Handling Multiple Github Accounts on MacOS

Handling Multiple Github Accounts on MacOS

The only way I've succeeded so far is to employ SSH.

Assuming you are new to this like me, first I'd like to share with you that your Mac has a SSH config file in a .ssh directory. The config file is where you draw relations of your SSH keys to each GitHub (or Bitbucket) account, and all your SSH keys generated are saved into .ssh directory by default. You can navigate to it by running cd ~/.ssh within your terminal, open the config file with any editor, and it should look something like this:

Host *
 AddKeysToAgent yes

> UseKeyChain yes

@minhlab
minhlab / count-wiki-cat.py
Created April 14, 2017 09:43
An attempt to count the number of pages (recursively) in a category in Wikipedia. It wasn't successful because the category of Vietnamese Wikipedia is cyclic and confusing.
# -*- coding: utf-8 -*-
import pywikibot
import sys
from collections import Counter
from random import randint
wiki = 'wikipedia'
lang = 'vi'
@up1
up1 / LoadingView.java
Last active February 12, 2021 17:13
Android Testing :: Custom View with Robolectric
public class LoadingView extends RelativeLayout {
public LoadingView(Context context) {
super(context);
}
public LoadingView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public LoadingView(Context context, AttributeSet attrs, int defStyle) {
@Jawnnypoo
Jawnnypoo / CrashlyticsTree.java
Created March 8, 2016 15:16
Timber tree which prints error messages and stack traces to Crashlytics
package com.example;
import android.util.Log;
import com.crashlytics.android.Crashlytics;
import timber.log.Timber;
/**
* {@link timber.log.Timber.Tree} which prints important messages to Crashlytics
@VincentMasselis
VincentMasselis / DateUtil.java
Last active May 31, 2021 09:49
Simple Java 7 RFC3339 parser (Android compatible)
/*
Inspired by http://cokere.com/RFC3339Date.txt
All rights deserve to Chad Okere
*/
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
@FireZenk
FireZenk / SnackbarAnimation.java
Last active August 11, 2020 13:06
With this class you can clone the {Snackbar} animation to move the {ViewGroup} above of the Snackbar when it is visible and avoid view overlapping (clone of fab animation)
package com.your.package;
import android.support.design.widget.Snackbar;
import android.view.View;
import android.view.ViewGroup;
import com.daimajia.easing.BaseEasingMethod;
import com.daimajia.easing.Glider;
import com.daimajia.easing.Skill;
import com.nineoldandroids.animation.AnimatorSet;
@gregkorossy
gregkorossy / VisionApiFocusFix.java
Last active November 22, 2019 11:38
Mobile Vision API fix for missing autofocus feature
/*
* IF YOU WANT TO JUST ACCESS THE CAMERA INSTANCE SO THAT YOU CAN SET ANY OF THE PARAMETERS, VISIT THE FOLLOWING LINK:
* https://gist.github.com/Gericop/364dd12b105fdc28a0b6
*/
/**
* Custom annotation to allow only valid focus modes.
*/
@StringDef({
Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE,