Skip to content

Instantly share code, notes, and snippets.

View ardianta's full-sized avatar
👋
hi!

Ahmad Muhardian ardianta

👋
hi!
View GitHub Profile
@ardianta
ardianta / webcam.html
Last active October 25, 2026 11:46
kode untuk menampilkan webcam dalam HTML
<div class="">
<video autoplay="true" id="video-webcam">
Izinkan untuk Mengakses Webcam untuk Demo
</video>
<button onclick="takeSnapshot()">Ambil Gambar</button>
</div>
<script>
var video = document.querySelector("#video-webcam");
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia || navigator.oGetUserMedia;
@ardianta
ardianta / input-form-google-maps.html
Created April 26, 2017 05:21
Form input google maps
{% include 'partial/head.html' %}
{% include 'partial/navbar.html' %}
<script src="https://maps.googleapis.com/maps/api/js?key=API_KEY"></script>
<script type="text/javascript">
// variabel global marker
var marker;
function taruhMarker(peta, posisiTitik) {
@ardianta
ardianta / Remove_MIUI_Bloatware.CMD
Created August 16, 2020 08:08
Remove bloatware applications from MIUI ROM in Xiaomi phones
@echo off
set /p Y=Enter adb.exe folder path:
cd /d %Y%
adb devices
pause
for %%X in (
"com.amazon.appmanager"
"com.android.browser"
"com.android.chrome"
"com.android.email"
@ardianta
ardianta / select_most_booking_hours.sql
Created November 11, 2024 02:46
Query to show the most active booking hours
SELECT
HOUR(CONVERT_TZ(`bookingCreatedAt`, '+00:00', '+08:00')) AS jam, -- convert UTC time to local time +08:00
COUNT(*) AS total_booking
FROM
Booking -- table name
WHERE
YEAR(`bookingCreatedAt`) = 2024 AND MONTH(`bookingCreatedAt`) = 10 -- month of year 2024
GROUP BY
jam
ORDER BY
@ardianta
ardianta / json-ld-blogger.xml
Last active April 4, 2024 14:09
Valid JSON-LD for Blogger
<script type="application/ld+json">
{ "@context": "http://schema.org",
"@type": "BlogPosting",
"headline": "<data:post.title/>",
"alternativeHeadline": "<data:post.title/>",
"mainEntityOfPage" : "<data:blog.homepageUrl/>",
"image": {
"@type" : "imageObject",
"url" : "<data:post.firstImageUrl/>",
"height": "480",
@ardianta
ardianta / remove-pdf-cover-batch.sh
Created December 6, 2023 05:46
Remove the first page of PDFs using pdftk
mkdir out
for i in *pdf; do pdftk "$i" cat 2-end output "out/$i"; done
@ardianta
ardianta / DataKaryawan.java
Last active October 3, 2023 10:13
Contoh penggunaan Scanner untuk mendapatkan input dari keyboard
package pertemuan2;
// mengimpor Scanner ke program
import java.util.Scanner;
public class DataKaryawan {
public static void main(String[] args) {
// deklarasi variabel
String nama, alamat;
@ardianta
ardianta / psxrip.sh
Last active April 10, 2022 21:03
PSX CD Ripping Script
#!/bin/bash
#
# This is a script to create a .bin image with corresponding .cue out of your
# PSX game discs as backup and/or for usage with emulators.
#
# Run-time requirements: cdrdao
#
# This script is partly based upon the "wesnoth-optipng" script from the
# Battle for Wesnoth team.
#
@ardianta
ardianta / php.ini
Created January 11, 2016 09:28
Konfigurasi server PHP saya di Xubuntu 15.10
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
@ardianta
ardianta / static-pages-hosting.md
Last active October 26, 2021 15:27
List tempat hosting web statis