Skip to content

Instantly share code, notes, and snippets.

View hoajb's full-sized avatar

Hoa Nguyen hoajb

  • EPAM Systems
  • Ho Chi Minh City, Viet Nam
  • 08:20 (UTC +07:00)
View GitHub Profile
@catalinmiron
catalinmiron / index.js
Created December 15, 2021 08:37
Starter Code - ScrollToIndex tutorial
import { Entypo, Feather } from '@expo/vector-icons';
import faker from 'faker';
import * as React from 'react';
import { Dimensions, FlatList, Text, TouchableOpacity, View } from 'react-native';
const { width, height } = Dimensions.get('screen');
faker.seed(10);
const data = [...Array(20).keys()].map(() => ({
@n1snt
n1snt / Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md
Last active September 26, 2024 06:32
Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active September 26, 2024 10:55
crack activate Office on mac with license file
@Kane-Shih
Kane-Shih / 00_READ_ME.txt
Last active December 6, 2023 18:17
Enable TLS 1.2 in Android 4.4
1. To enable TLS 1.2 in Android 4.4
Copy TLSSocketFactory.java
If using HttpsURLConnection:
=> conn.setSSLSocketFactory(new TLSSocketFactory());
Else if using OkHttp:
=> new OkHttpClient.Builder().setSocketFactory(new TLSSocketFactory()). ... .build();
Else if using HttpClient:
sample for legacy apache http library: https://github.com/Kane-Shih/TestApacheHttpClient
=> see: https://stackoverflow.com/questions/2603691/android-httpclient-and-https
@mohsin
mohsin / KEYSTORE.md
Last active January 4, 2021 22:05
Using Keystore properties in Android Projects
  1. Add to project-level build.gradle:
allprojects {
    ...
    afterEvaluate { project ->
        def propsFile = rootProject.file('keystore.properties')
        def configName = 'release'

        if (propsFile.exists() && project.hasProperty("android") && project.android.signingConfigs.hasProperty(configName)) {
@codediodeio
codediodeio / database.rules.json
Last active September 1, 2024 22:58
Common Database Rules for Firebase
// No Security
{
"rules": {
".read": true,
".write": true
}
}
@layerlre
layerlre / IntentFacebook.java
Last active January 9, 2023 15:02
Open Facebook Page URL in Facebook app with Intent
....
public void startFacebook(String facebookUrl) {
try {
Uri uri = null;
int versionCode = getPackageManager()
.getPackageInfo("com.facebook.katana", 0)
.versionCode;
@oanhnn
oanhnn / using-multiple-github-accounts-with-ssh-keys.md
Last active September 26, 2024 04:10
Using multiple github accounts with ssh keys

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@NikolaDespotoski
NikolaDespotoski / ToolbarAlphaScrollBehavior.java
Last active January 15, 2020 20:44
Toggle Toolbar background alpha and alpha of its title view.
public class ToolbarAlphaScrollBehavior extends CoordinatorLayout.Behavior<android.support.v7.widget.Toolbar> {
private ColorDrawable mStatusBarColorDrawable;
private int mStatusBarColor;
private TextView mTitleView;
private boolean searchedForTitleView = false;
public ToolbarAlphaScrollBehavior(Context context, AttributeSet attrs) {
super(context, attrs);
mStatusBarColor = ContextCompat.getColor(context, R.color.primary_dark);
mStatusBarColor = getColorWithAlpha(0, mStatusBarColor);