Skip to content

Instantly share code, notes, and snippets.

@fdln
fdln / test.js
Last active March 3, 2020 04:58
asd
asdf
asdf
asdf
asdf
asdf
asd
fa
@startuml styleparam
' skinparam monochrome true
!define ACCENT #E29B2C
!define BACKGROUND #242533
!define BOXCOLOR #2B2B2B
skinparam backgroundColor BACKGROUND
' skinparam handwritten true
skinparam shadowing false
skinparam collections {
@fdln
fdln / bd3d4befe38185704bf0fc875e9deed6|configuration.json
Last active December 14, 2018 20:42
Visual Studio Code Settings Sync Gist
{"contents":{"editor":{"renderIndentGuides":true,"codeLens":false,"tabSize":2,"fontLigatures":true,"fontFamily":"Fira Code","lineNumbers":"relative","rulers":[80,120],"hover":{"delay":1000},"parameterHints":{"cycle":true},"formatOnPaste":true,"showFoldingControls":"always","folding":true,"foldingStrategy":"indentation"},"[javascriptreact]":{},"javascript":{"updateImportsOnFileMove":{"enabled":"always"}},"files":{"eol":"\n"}},"overrides":[{"identifiers":["javascriptreact"],"contents":{}}],"keys":["editor.renderIndentGuides","[javascriptreact]","editor.codeLens","editor.tabSize","editor.fontLigatures","editor.fontFamily","editor.lineNumbers","editor.rulers","javascript.updateImportsOnFileMove.enabled","editor.hover.delay","editor.parameterHints.cycle","editor.formatOnPaste","editor.showFoldingControls","editor.folding","editor.foldingStrategy","files.eol"]}
@fdln
fdln / results.txt
Created August 16, 2017 16:19 — forked from maxpert/results.txt
JSON vs MsgPack using Gzip + LZ4
Original tweet size in JSON 2624 Msgpack = 1817 Gzip + Json = 1058 Gzip + Msgpack = 1116 LZ4 + Json = 1628 LZ4 + Msgpack = 1361
Original tweet size in JSON 1863 Msgpack = 1443 Gzip + Json = 0783 Gzip + Msgpack = 0835 LZ4 + Json = 1153 LZ4 + Msgpack = 1040
Original tweet size in JSON 2074 Msgpack = 1670 Gzip + Json = 0842 Gzip + Msgpack = 0894 LZ4 + Json = 1229 LZ4 + Msgpack = 1139
Original tweet size in JSON 2025 Msgpack = 1617 Gzip + Json = 0845 Gzip + Msgpack = 0895 LZ4 + Json = 1238 LZ4 + Msgpack = 1143
Original tweet size in JSON 2069 Msgpack = 1663 Gzip + Json = 0846 Gzip + Msgpack = 0901 LZ4 + Json = 1243 LZ4 + Msgpack = 1164
Original tweet size in JSON 2035 Msgpack = 1634 Gzip + Json = 0852 Gzip + Msgpack = 0907 LZ4 + Json = 1247 LZ4 + Msgpack = 1167
Original tweet size in JSON 1988 Msgpack = 1464 Gzip + Json = 0804 Gzip + Msgpack = 0862 LZ4 + Json = 1220 LZ4 + Msgpack = 1061
Original tweet size in JSON 1910 Msgpack = 1502 Gzip + Json = 0775 Gzip + Msgpack = 0832 LZ4 + Json = 1154 LZ4 + Msgpack = 1060

JSON Data Type

Format Json data yang akan di consume Mobile App. Value untuk null digantikan ke empty value untuk masing-masing tipe datanya.

Type Acceptable Value Empty Value (null)
string "Lorem ipsum"

"Dolor \nSit amet"
""
integer 42
-42
0
float 1.234
-12.345
0
boolean true
false
false
@fdln
fdln / TimeAgo.java
Created April 27, 2017 19:40 — forked from tediscript/TimeAgo.java
Time Ago Library for Java
package com.tediscript.time;
/**
*
* @author tediscript
*/
public class TimeAgo {
public static long SECOND = 1000l;
public static long MINUTE = SECOND * 60l;
@fdln
fdln / Count Code lines
Created February 24, 2017 05:00 — forked from amitchhajer/Count Code lines
Count number of code lines in git repository per user
git ls-files -z | xargs -0n1 git blame -w | perl -n -e '/^.*\((.*?)\s*[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n
@fdln
fdln / AddCookiesInterceptor.java
Created February 16, 2017 09:37 — forked from tsuharesu/AddCookiesInterceptor.java
Handle Cookies easily with Retrofit/OkHttp
/**
* This interceptor put all the Cookies in Preferences in the Request.
* Your implementation on how to get the Preferences MAY VARY.
* <p>
* Created by tsuharesu on 4/1/15.
*/
public class AddCookiesInterceptor implements Interceptor {
@Override
public Response intercept(Chain chain) throws IOException {
@fdln
fdln / AddCookiesInterceptor.java
Created February 16, 2017 09:34 — forked from nikhiljha/AddCookiesInterceptor.java
Retrofit2/OkHttp3 Cookies (Drag and Drop, One Size Fits 99%)
// Original written by tsuharesu
// Adapted to create a "drop it in and watch it work" approach by Nikhil Jha.
// Just add your package statement and drop it in the folder with all your other classes.
import android.content.Context;
import android.preference.PreferenceManager;
import android.util.Log;
import java.io.IOException;
import java.util.HashSet;
@fdln
fdln / BaseAdapter.java
Created October 30, 2016 01:15 — forked from mannodermaus/BaseAdapter.java
RecyclerView.ViewHolder and Adapter demonstration
public abstract class BaseAdapter<T, VH extends BaseViewHolder<T>> extends RecyclerView.Adapter<VH> {
private List<T> items;
// Missing: setItems(), addItem(), removeItem(), ...
@Override
public final void onBindViewHolder(VH vh, int position) {
T item = items.get(position);
vh.performBind(item, position);