This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
axios = require('axios') | |
var arr = []; | |
axios.get('http://dev.farizdotid.com/api/daerahindonesia/provinsi/12/kabupaten') | |
.then((result) => { | |
result.data.daftar_kecamatan.map((data) => { | |
axios.get('http://dev.farizdotid.com/api/daerahindonesia/provinsi/kabupaten/' + data.id + '/kecamatan') | |
.then((res) => { | |
arr = res.data.daftar_kecamatan.reduce((prev, next) => prev.concat(next.nama), arr) | |
console.log(JSON.stringify(arr)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Welcome! require() some modules from npm (like you were using browserify) | |
// and then hit Run Code to run your code on the right side. | |
// Modules get downloaded from browserify-cdn and bundled in your browser. | |
var speakeasy = require("speakeasy"); | |
var action = function() { | |
var result = document.getElementById('value'); | |
var amount = document.getElementById('amount').value; | |
var secret = "FuoEvOIGXGNBlMkCp3IAQgoj4eyaNsVH6igi6lD01B5eVmIh7OfOqP6/RI48o4zaXWCyNBzR0S1x6MI1lCYyXg=="; | |
var token = speakeasy.totp({ | |
secret: secret, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*depedencies: eslint babel-eslint eslint-plugin-babel eslint-plugin-react */ | |
{ | |
"parser": "babel-eslint", | |
"env": { | |
"browser": true, | |
"node": true, | |
"es6": true | |
}, | |
"plugins": ["react"], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.springkraf.perwira.adapter; | |
import android.content.Context; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import com.springkraf.perwira.R; | |
import com.springkraf.perwira.api.exception.ApiError; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class VerticalItemDecoration extends DividerItemDecoration { | |
public VerticalItemDecoration(Context context, Drawable drawable) { | |
super(context, DividerItemDecoration.VERTICAL); | |
this.setDrawable(drawable); | |
} | |
public VerticalItemDecoration(Context context, int height, int color) { | |
this(context, shapeDrawableHelper(context, height, color)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CloneHelper { | |
public static <T> T clone(T object) { | |
return new Clone<T>(object).getClone(); | |
} | |
private static class Clone<T> { | |
T object; | |
private Clone(T object) { |