Skip to content

Instantly share code, notes, and snippets.

View anta40's full-sized avatar

Andre anta40

  • Jakarta, Indonesia
  • 13:24 (UTC +07:00)
View GitHub Profile
Undefined symbols for architecture arm64:
"_CFStringCreateWithCString", referenced from:
_main in ios_hello_world-cc7860.o
"_UIApplicationMain", referenced from:
_main in ios_hello_world-cc7860.o
"_class_addMethod", referenced from:
_main in ios_hello_world-cc7860.o
"_class_addProtocol", referenced from:
_main in ios_hello_world-cc7860.o
"_class_createInstance", referenced from:
@anta40
anta40 / disable_back.tsx
Created September 13, 2025 03:53
Disable back button on React Native
useEffect(() => {
const backAction = () => {
return true;
};
BackHandler.addEventListener('hardwareBackPress', backAction);
return () =>
BackHandler.removeEventListener('hardwareBackPress', backAction);
}, []);
import static androidx.core.app.ActivityCompat.startActivityForResult;
import android.app.Activity;
import android.content.Intent;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ActivityEventListener;
@anta40
anta40 / FormDataRetrofit.txt
Last active June 2, 2025 17:33
Form data pakai Retrofit
// Deklarasi end point di interface
@POST("v2/something")
Call<SomeResponse> doSomethingWithForm(@Body RequestBody request);
// Buat dulu form data
// Isi dengan field2 yang diinginkan
MultipartBody.Builder builder = new MultipartBody.Builder();
builder.setType(MultipartBody.FORM);
builder.addFormDataPart("field_1", "nilai1");
builder.addFormDataPart("field_2", "nilai2");
@anta40
anta40 / NumericTextWatcher.java
Created May 11, 2025 10:25
Custom numeric on TextWatcher
/*
Source: https://stackoverflow.com/questions/41734700/how-to-add-thousand-separator-in-android-edittext
*/
editText.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
@anta40
anta40 / .zshrc
Created April 6, 2025 16:12
m2 zshrc 2025
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH
export LC_ALL=en_US.UTF-8
# Hack-ish commands
#alias tmp-hack="export TMPDIR=/tmp"
export TMPDIR=/tmp
# Path to your Oh My Zsh installation.
export ANDROID_HOME=/Users/andretampubolon/Library/Android/sdk
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import com.google.android.gms.maps.CameraUpdateFactory
import com.google.android.gms.maps.GoogleMap
import com.google.android.gms.maps.OnMapReadyCallback
import com.google.android.gms.maps.SupportMapFragment
import com.google.android.gms.maps.model.BitmapDescriptorFactory
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical"
tools:context=".AboutFragment">
package main
/*
Check for email from a certain sender (e.g [email protected]), grab the Excel attachment
Schedule this with cron or whatever...
*/
import (
"fmt"
@anta40
anta40 / read_inbox_v1.go
Last active September 11, 2023 13:11
Read all emails in inbox with go-imap v1
package main
import (
"fmt"
"log"
"github.com/emersion/go-imap"
"github.com/emersion/go-imap/client"
"github.com/emersion/go-message/mail"
)