Skip to content

Instantly share code, notes, and snippets.

View zgramming's full-sized avatar
🇮🇩
Indonesia

Zeffry Reynando - 本当 に zgramming

🇮🇩
Indonesia
View GitHub Profile
@zgramming
zgramming / Response
Created September 14, 2023 16:15
Response Sent & Delivered SMS
E/METHOD_CHANNEL_UTILS(15799): Message content: Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptas ipsa nemo aspernatur asperiores! Error ipsa sunt voluptatibus ex iusto et perferendis aspernatur corrupti, enim unde. Delectus voluptate quisquam quas possimus?
E/METHOD_CHANNEL_UTILS(15799): Message length: 226
E/SENT_SMS_RECEIVER(15799): Called with {message=SMS_RESULT_OK : SMS sent successfully, code=-1, status=true, surveyResponseId=}
E/DELIVERED_SMS_RECEIVER(15799): RESULT_OK
E/DELIVERED_SMS_RECEIVER(15799): Called with {message=SMS_RESULT_OK : SMS delivered successfully, code=-1, status=true}
@zgramming
zgramming / DeliveredSMSReceiver.kt
Created September 14, 2023 16:13
Delivered SMS Receiver
import android.app.Activity.RESULT_OK
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.provider.Telephony
import android.telephony.SmsManager
import android.util.Log
import io.flutter.plugin.common.EventChannel
class DeliveredSMSReceiver : BroadcastReceiver(), EventChannel.StreamHandler {
@zgramming
zgramming / SentSMSReceiver.kt
Created September 14, 2023 16:12
Sent SMS Receiver
import android.app.Activity.RESULT_OK
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.telephony.SmsManager
import android.util.Log
import io.flutter.plugin.common.EventChannel
import io.flutter.plugin.common.EventChannel.StreamHandler
@zgramming
zgramming / SendSMS.kt
Last active September 14, 2023 16:12
Function to send SMS in Kotlin
import android.Manifest
import android.app.PendingIntent
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.content.pm.PackageManager
import android.telephony.SmsManager.getSmsManagerForSubscriptionId
import android.telephony.SubscriptionManager
@zgramming
zgramming / Step Step Enable
Created September 6, 2022 12:49
Enable MYSQL Remote Connection
MYSQL ENABLE REMOTE CONNECTION
SELECT user, host, plugin from mysql.user;
sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf
bind-address = 0.0.0.0 (ubah dari 127.0.0.0 ke 0.0.0.0)
CREATE USER 'zeffry'@'%' IDENTIFIED WITH mysql_native_password BY 'YOUR-STRONG-PASSWORD';
GRANT ALL PRIVILEGES ON *.* TO 'zeffry'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
@zgramming
zgramming / next js step install
Last active November 12, 2022 14:40
Deploy Next JS into VPS
TUTORIAL INSTALL PROJECT NEXT JS / REACT JS KE VPS
Referensi : https://medium.com/@handri.pangestiaji/next-js-serve-multiple-next-js-app-dengan-pm2-dan-nginx-8f71f71626c3
Referensi subdomain : https://adamtheautomator.com/nginx-subdomain/
sudo apt update
sudo apt upgrade
sudo mkdir /var/www/NAMA_FOLDER_PROJECT
Install NVM ( Node Version Manager)
* curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
* nvm install --lts
CARA CLONE PRIVATE REPOSITORY GITHUB
1. Buat Personal Access Token
2. git clone https://<YOUR_PERSONAL_ACCESS_TOKEN>@github.com/<your account or organization>/<repo>.git
3. git clone https://123456789@github.com/zgramming/laravel-starter-project.git
@zgramming
zgramming / Deploy Laravel on VPS
Last active November 5, 2022 13:55
How to deploy laravel project on your VPS
TUTORIAL INSTALL PROJECT LARAVEL DI VPS
Source Tutorial : https://www.youtube.com/watch?v=ZiqE6uOTbf4
Referensi subdomain : https://adamtheautomator.com/nginx-subdomain/
REVISI
- sudo apt update
- sudo apt upgrade
- sudo apt install ca-certificates apt-transport-https
- sudo apt install software-properties-common
@zgramming
zgramming / php_form_submit.md
Created January 11, 2022 15:53 — forked from jesperorb/php_form_submit.md
PHP form submitting with fetch + async/await

PHP Form submitting

If we have the following structure in our application:

  • 📁 application_folder_name
    • 📄 index.php
    • 📄 handle_form.php
    • 📄 main.js

And we fill our index.php with the following content just to get a basic website with a form working. You should be able to run this through a php-server of your choice.

import 'dart:convert';
void main(){
var json = '''
[
{
"descricao" : "deskripsi 1",
"data_acao" : "2021-11-09",
"hora_inicial_acao" : "08:00:00",
"hora_final_acao" : "12:00:00"