Skip to content

Instantly share code, notes, and snippets.

View CoderJava's full-sized avatar
🏠
Stay Safe. #WFH

Yudi Setiawan CoderJava

🏠
Stay Safe. #WFH
View GitHub Profile
@CoderJava
CoderJava / singletonExample.java
Created July 16, 2017 05:00 — forked from ademar111190/singletonExample.java
One month with Kotlin: singleton example
// Using Singleton on Kotlin
public object MySingleton {
public fun foo() {
}
}
// And use it on Kotlin
MySingleton.foo()
@CoderJava
CoderJava / BluetoothPrinter.java
Created September 15, 2017 09:22 — forked from putraxor/BluetoothPrinter.java
Utilitas untuk printer thermal bluetooth
package id.bitcase.ocafe.utility;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothSocket;
import android.graphics.Bitmap;
import android.os.AsyncTask;
import android.util.Log;
import java.io.IOException;
@CoderJava
CoderJava / tmux.md
Created June 1, 2018 04:06 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@CoderJava
CoderJava / SerializationHelper.java
Last active June 24, 2018 04:07
Serialization Helper for Nearby Connections API
public class SerializationHelper {
public static byte[] serialize(Object object) throws IOException{
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
ObjectOutputStream objectOutputStream = new ObjectOutputStream(byteArrayOutputStream);
// transform object to stream and then to a byte array
objectOutputStream.writeObject(object);
objectOutputStream.flush();
objectOutputStream.close();
return byteArrayOutputStream.toByteArray();
}
{
"nama": "Yudi Setiawan",
"hobi": [
"menulis",
"membaca",
"bersepeda"
],
"usia": 23
}
@CoderJava
CoderJava / example_json_object.json
Created July 23, 2018 02:35
Example JSON Object
{
"nama": "Yudi Setiawan",
"hobi": [
"menulis",
"membaca",
"bersepeda"
],
"usia": 23,
"orang_tua": {
"ibu": {
@CoderJava
CoderJava / example_json_array.json
Created July 23, 2018 02:42
Example JSON Array
[
{
"string": "Ini String",
"number": 1,
"boolean": false,
"array": []
}
]
@CoderJava
CoderJava / example_string_in_json.json
Created July 23, 2018 02:45
Example String in JSON
{
"nama_depan": "Yudi",
"nama_belakang": "Setiawan"
}
@CoderJava
CoderJava / example_number_in_json.json
Last active July 23, 2018 10:55
Example Number in JSON
{
"long": 10,
"double": 10.5
}
@CoderJava
CoderJava / example_boolean_in_json.json
Created July 23, 2018 02:50
Example Boolean in JSON
{
"isMan": true,
"isWoman": false
}