Skip to content

Instantly share code, notes, and snippets.

@vuhung3990
vuhung3990 / degrees2meters.js
Created August 3, 2021 00:34 — forked from onderaltintas/degrees2meters.js
javascript coordinate conversions between 900913(3857) - 4326(lat lon)
var degrees2meters = function(lon,lat) {
var x = lon * 20037508.34 / 180;
var y = Math.log(Math.tan((90 + lat) * Math.PI / 360)) / (Math.PI / 180);
y = y * 20037508.34 / 180;
return [x, y]
}
//test
lon= -77.035974
lat = 38.898717
@vuhung3990
vuhung3990 / rank.json
Last active September 29, 2019 04:48
sample
{
"last_update": "2019/09/29 12:00:17",
"data": [
{
"index": 1,
"flag": "vn",
"city": "Ha Noi",
"nation": "Viet Nam",
"aqi": 180
},

Keybase proof

I hereby claim:

  • I am vuhung3990 on github.
  • I am petertux (https://keybase.io/petertux) on keybase.
  • I have a public key ASDIoJzOCbmTyRCKu6UlZ5leJZj9mM9n4ww8V-_FUw5vYwo

To claim this, I am signing this object:

<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>MobileLiveChat: Activity</title>
<link rel="self" href="http://10.64.100.201/projects/mobilelivechat/activity.atom?key=5817b30bb840c72acd2b1e4771c0022ea87e9c4e"/>
<link rel="alternate" href="http://10.64.100.201/projects/mobilelivechat/activity"/>
<id>http://10.64.100.201/</id>
<icon>http://10.64.100.201/favicon.ico</icon>
<updated>2019-04-26T10:28:57Z</updated>
<author>
<name>Redmine</name>
@vuhung3990
vuhung3990 / .editorconfig
Created September 20, 2018 13:41
EditorConfig for android project (2 space style)
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*.{java,kt,xml}]
end_of_line = lf
insert_final_newline = true
<!DOCTYPE html><html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>Privacy Policy</title> <style>body{font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; padding:1em;}</style></head> <body><h2>Privacy Policy</h2> <p> built the Chuyển đổi 11 số sang 10 số các mạng app as a Free app. This SERVICE is provided by at no cost and is intended for use as is.
</p> <p>This page is used to inform visitors regarding my policies with the collection, use, and
disclosure of Personal Information if anyone decided to use my Service.
</p> <p>If you choose to use my Service, then you agree to the collection and use of information in relation
to this policy. The Personal Information that I collect is used for providing and improving the
Service. I will not use or share your information with anyone except as described
in this Privacy Policy.
</
@vuhung3990
vuhung3990 / Test.java
Created June 20, 2017 10:46
test intent
public class MainActivityTest {
@Rule
public IntentsTestRule<MainActivity> rule = new IntentsTestRule<MainActivity>(MainActivity.class);
@Test
public void openExport_shouldPass() throws Exception {
onView(withId(R.id.export_contact)).perform(click());
intended(
allOf(
@vuhung3990
vuhung3990 / ImageSliderAdapter.java
Last active August 1, 2019 08:05
simple image slider for android
public class ImageSliderAdapter extends FragmentPagerAdapter {
private final List<Fragment> fragmentList = new ArrayList<>();
public ImageSliderAdapter(@NonNull FragmentManager fm) {
super(fm);
}
@Override
public Fragment getItem(int position) {
return fragmentList.get(position);
@vuhung3990
vuhung3990 / MainActivityTest.java
Last active March 7, 2017 12:18
- espresso pull to refresh and load more basic - RecyclerViewActions: androidTestCompile("com.android.support.test.espresso:espresso-contrib:$espressoVersion") { // Necessary to avoid version conflicts exclude group: 'com.android.support', module: 'appcompat' exclude group: 'com.android.support', module: 'support-v4' exclude group: 'com.android.…
package com.dev22.dealhunter;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import static android.support.test.espresso.Espresso.onView;
@vuhung3990
vuhung3990 / DetectScrollToEnd.java
Last active August 14, 2017 06:57
recycleview load more helper
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
/**
* Created by dev22 on 3/1/17.
* helper class for detect when recyclerView scroll to bottom and load more data
*/
public abstract class DetectScrollToEnd extends RecyclerView.OnScrollListener {
private final LinearLayoutManager layoutManager;
private final int mThreshold;