Skip to content

Instantly share code, notes, and snippets.

View alexwawo's full-sized avatar
hyper-focused

Alex Wawo alexwawo

hyper-focused
View GitHub Profile
<div style="page-break-after: always;"></div>

select.php

<?php
if(isset($_SERVER['HTTP_ORIGIN'])){
	header('Access-Control-Allow-Origin: *');
	header('Access-Control-Allow-Methods: POST, PUT, DELETE, OPTIONS');
	header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept');
}

$koneksi = mysqli_connect('127.0.0.1', 'root', '', 'umn_if733_2020');
@alexwawo
alexwawo / Ionic-React-Google-Maps-Example.tsx
Last active October 22, 2021 05:03
Display Google Map on Ionic-React
// https://www.npmjs.com/package/@react-google-maps/api
// https://react-google-maps-api-docs.netlify.app
import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar } from '@ionic/react';
import {GoogleMap, LoadScript} from "@react-google-maps/api";
import React from "react";
const Home: React.FC = () => {
const center = {lat:-6.257386862450975, lng:106.61825929826999};
const containerStyle = {
@alexwawo
alexwawo / Ionic-React-Geolocation-Example.tsx
Last active October 22, 2021 05:04
Capacitor Geolocation, move map position to current location
import {IonButton, IonContent, IonHeader, IonPage, IonTitle, IonToolbar} from '@ionic/react';
import {GoogleMap, LoadScript} from "@react-google-maps/api";
import {Geolocation} from "@capacitor/geolocation";
import React, {useState} from "react";
const Home: React.FC = () => {
const [lat, setLat] = useState(0);
const [lng, setLng] = useState(0);
const containerStyle = {
@alexwawo
alexwawo / Ionic-React-CapacitorCommunity-GoogleMapsNative-Example.tsx
Last active October 22, 2021 05:11
Not Working. Error on Android Studio.
// https://github.com/capacitor-community/capacitor-googlemaps-native
import {IonContent, IonHeader, IonPage, IonTitle, IonToolbar} from '@ionic/react';
import React, {useRef} from "react";
import {CapacitorGoogleMaps} from "@capacitor-community/capacitor-googlemaps-native";
const Home: React.FC = () => {
const map = useRef<HTMLDivElement>(null);
const boundingRect = map.current?.getBoundingClientRect() as DOMRect;
import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar } from '@ionic/react';
import {GoogleMap, LoadScript, Marker} from "@react-google-maps/api";
import React, {useState} from "react";
const Home: React.FC = () => {
const center = {lat:-6.257386862450975, lng:106.61825929826999};
const [lat, setLat] = useState<number>(-6.257386862450975);
const [lng, setLng] = useState<number>(106.61825929826999);
const containerStyle = {
width: '100%',
import {IonButton, IonContent, IonHeader, IonPage, IonTitle, IonToolbar} from '@ionic/react';
import {useEffect, useState} from "react";
const Home: React.FC = () => {
const [data, setData] = useState(null);
const url = "http://kuliah.seedlab.id/if633/api/ambil_semua_mahasiswa.php";
const getAllDataHandler = () => {
fetch(url)
.then(response => response.json())
@alexwawo
alexwawo / PHP-Process-POST-Request.php
Created October 29, 2021 04:11
API for Ionic-React-Send-POST-Request.jsx
<?php
if(isset($_SERVER['HTTP_ORIGIN'])){
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: POST, PUT, DELETE, OPTIONS');
header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept');
}
// get data
$data = [];
$data = json_decode(file_get_contents('php://input'), true);
import {
IonButton,
IonContent,
IonHeader,
IonInput,
IonItem,
IonLabel,
IonPage,
IonTitle,
IonToolbar
import {
IonContent,
IonHeader,
IonPage,
IonTitle,
IonToolbar
} from '@ionic/react';
import {useEffect, useState} from "react";
import axios from "axios";