Skip to content

Instantly share code, notes, and snippets.

View hoanganhx86's full-sized avatar

Anh Nguyen(Andy) hoanganhx86

View GitHub Profile
@hoanganhx86
hoanganhx86 / gist:2645607b9bcb8fb1132400377d507fa9
Created April 8, 2020 09:24
Fix LIBRARY_SEARCH_PATHS on RN 0.62
https://github.com/facebook/react-native/issues/28483#issuecomment-610839293
@hoanganhx86
hoanganhx86 / gist:37fded2c89b03aa74ba54f23b02f4ade
Created April 8, 2020 09:24
Fix LIBRARY_SEARCH_PATHS on RN 0.62
https://github.com/facebook/react-native/issues/28483#issuecomment-610839293
@hoanganhx86
hoanganhx86 / difference.js
Created December 26, 2019 08:48 — forked from Yimiprod/difference.js
Deep diff between two object, using lodash
/**
* Deep diff between two object, using lodash
* @param {Object} object Object compared
* @param {Object} base Object to compare with
* @return {Object} Return a new object who represent the diff
*/
function difference(object, base) {
function changes(object, base) {
return _.transform(object, function(result, value, key) {
if (!_.isEqual(value, base[key])) {
@hoanganhx86
hoanganhx86 / .zshrc
Created July 10, 2017 08:05 — forked from zanshin/.zshrc
My .zshrc file
# Path to your oh-my-zsh configuration.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
#export ZSH_THEME="robbyrussell"
export ZSH_THEME="zanshin"
@hoanganhx86
hoanganhx86 / gist:efcfaddd8f6f3acad21f5a65d6e99982
Created April 22, 2017 08:39 — forked from dodyg/gist:5616605
Kotlin Programming Language Cheat Sheet Part 2

This is a quick guide to Kotlin programming language. The previous part of this guide is here

#Object Oriented

fun main(args : Array<String>) {
  class local (val x : Int)
  
  val y = local(10)
 println("${y.x}")
@hoanganhx86
hoanganhx86 / gist:dafb4da05b3c4ef6fb54d0a05cd08eb0
Created April 22, 2017 08:38 — forked from dodyg/gist:5823184
Kotlin Programming Language Cheat Sheet Part 1

#Intro

Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at kotlin.jetbrains.org.

All the codes here can be copied and run on Kotlin online editor.

Let's get started.

@hoanganhx86
hoanganhx86 / android_instructions.md
Created December 21, 2016 10:46 — forked from patrickhammond/android_instructions.md
Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

/*
* Copyright 2016 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@hoanganhx86
hoanganhx86 / RxJava.md
Created November 15, 2016 06:24 — forked from cesarferreira/RxJava.md
Party tricks with RxJava, RxAndroid & Retrolambda

View Click

Instead of the verbose setOnClickListener:

RxView.clicks(submitButton).subscribe(o -> log("submit button clicked!"));

Filter even numbers

Observable
    .just(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
@hoanganhx86
hoanganhx86 / ApiModule.java
Created September 16, 2016 08:22 — forked from koesie10/ApiModule.java
Retrofit 1 error handling behaviour in Retrofit 2
// Dagger 1 example
@Module(
complete = false,
library = true
)
public final class ApiModule {
@Provides
@Singleton
Retrofit provideRetrofit(Gson gson, Application app) {
return new Retrofit.Builder()