Skip to content

Instantly share code, notes, and snippets.

View vudunguit's full-sized avatar

Vu Dung vudunguit

  • Project Kanzen
  • Ho Chi Minh city, Viet Nam
View GitHub Profile
@vudunguit
vudunguit / appdetails.json
Created February 14, 2020 10:12
vpn configurations
{"ads":"false","update":[{"version":"2.8.2000","title":"This app is now Open Source","description":"The App is available at github.com/gayankuruppu/android-vpn-client-ics-openvpn","size":"https://git.io/JeY69"}],"blocked":[{"id":0,"app":"com.android.game"},{"id":1,"app":"com.utorrent.client"},{"id":2,"app":"com.torrent.client"},{"id":3,"app":"com.tor.client"},{"id":4,"app":"com.insta.client"},{"id":5,"app":"com.facebook.client"},{"id":6,"app":"com.get.client"}],"free":[{"id":0,"file":0,"city":"73.239.44.11","country":"United States","image":"unitedstates","ip":"73.239.44.11","active":"true","signal":"a"},{"id":1,"file":1,"city":"172.119.125.80","country":"United States","image":"unitedstates","ip":"172.119.125.80","active":"true","signal":"a"},{"id":2,"file":2,"city":"198.27.183.33","country":"United States","image":"unitedstates","ip":"198.27.183.33","active":"true","signal":"a"},{"id":3,"file":3,"city":"80.246.28.38","country":"United States","image":"unitedstates","ip":"80.246.28.38","active":"true","signa
@vudunguit
vudunguit / filedetails.json
Last active February 14, 2020 10:13
VPN configurations
{"ovpn_file":[{"id":0,"file":"dev tun proto udp remote 73.239.44.11 1442 cipher AES-128-CBC auth SHA1 resolv-retry infinite nobind persist-key persist-tun client verb 3 \u003cca\u003e -----BEGIN CERTIFICATE----- MIIF2DCCA8CgAwIBAgIQTKr5yttjb+Af907YWwOGnTANBgkqhkiG9w0BAQwFADCB hTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNV BAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTAwMTE5 MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0IxGzAZBgNVBAgT EkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR Q09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNh dGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCR 6FSS0gpWsawNJN3Fz0RndJkrN6N9I3AAcbxT38T6KhKPS38QVr2fcHK3YX/JSw8X pz3jsARh7v8Rl8f0hj4K+j5c+ZPmNHrZFGvnnLOFoIJ6dq9xkNfs/Q36nGz637CC 9BR++b7Epi9Pf5l/tfxnQ3K9DADWietrLNPtj5gcFKt+5eNu/Nio5JIk2kNrYrhV /erBvGy2i/MOjZrkm2xpmfh4SDBF1a3hDTxFYPwyllEnvGfDyi62a+pGx8cgoLEf Zd5ICLqkTqnyg0Y3hOvozIFIQ2dOciqb
@vudunguit
vudunguit / DownloadRequest.kt
Created December 12, 2018 05:12 — forked from PrashamTrivedi/DownloadRequest.kt
Download File with progress indicator, written in Kotlin with Co-routines
suspend fun downloadFile(url: String,
downloadFile: File,
downloadProgressFun: (bytesRead: Long, contentLength: Long, isDone: Boolean) -> Unit) {
async(CommonPool) {
val request = with(Request.Builder()) {
url(url)
}.build()
val client = with(OkHttpClient.Builder()) {
addNetworkInterceptor { chain ->
@vudunguit
vudunguit / Data.kt
Created May 23, 2018 10:05 — forked from florina-muntenescu/Data.kt
Using RoomDatabase#Callback to pre-populate the database - https://medium.com/google-developers/7-pro-tips-for-room-fbadea4bfbd1
/*
* Copyright (C) 2017 The Android Open Source Project
*
* 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
@vudunguit
vudunguit / BuildOkHttpClient
Created May 10, 2018 11:08
Cache OkHttpClient
OkHttpClient.Builder okHttpClientBuilder = new OkHttpClient.Builder()
.cache(cache)
.addInterceptor(new RewriteRequestInterceptor())
.addNetworkInterceptor(new RewriteResponseCacheControlInterceptor())
@vudunguit
vudunguit / InstaModel
Created August 9, 2017 02:53
Instagram accesstoken (sample)
public class InstaModel {
public static final String CLIENT_ID = "31f1cc932c264e5da2711ad437753c78";
public static final String CLIENT_SECRET = "3db8f5ff74474cadba35a6a2bf518b5d";
public static final String CALLBACK_URL = "https://medium.com/@vutiendunguit";
public static final String GRANT_TYPE = "authorization_code";
public static final String AUTH_URL = "https://api.instagram.com/oauth/authorize/";
public static final String TOKEN_URL = "https://api.instagram.com/oauth/access_token";
public static final String API_URL = "https://api.instagram.com/v1";
@vudunguit
vudunguit / TabControler.kt
Last active April 18, 2018 08:04
Class help views check change controller, same RadioGroup but more flexible
import android.view.View
class TabControler : View.OnClickListener {
private var listener: OnCheckedChangeListener? = null
private val tabs = mutableListOf<View>()
private var lastSelected: Int = 0
fun setTabs(firstSelected: Int, vararg views: View) {
tabs.clear()
for (i in views.indices) {
@vudunguit
vudunguit / RxJava.md
Created May 3, 2017 04:18 — 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)
@vudunguit
vudunguit / color hex percentage
Created February 24, 2017 04:07
Android Material Design Colours
100% — FF
99% — FC
98% — FA
97% — F7
96% — F5
95% — F2
94% — F0
93% — ED
92% — EB
91% — E8
@vudunguit
vudunguit / LocationHelper
Created September 26, 2016 08:35
LocationHelper is a class help deal with location service
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.location.Location;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.text.TextUtils;
import android.util.Log;