Skip to content

Instantly share code, notes, and snippets.

View agungsp2000's full-sized avatar
😴

Agung Sagita agungsp2000

😴
View GitHub Profile
@agungsp2000
agungsp2000 / master-detail.php
Created May 21, 2022 12:52 — forked from cuheguevara/master-detail.php
Master Detail PHP jQuery
<?php
if (isset($_POST["tombol"]))
{
echo "<pre>";
//print_r($_POST);
echo "</pre>";
$head = $_POST["head"];
$detail = $_POST["item"];
echo "Head Looping Foreach <br/>";
@agungsp2000
agungsp2000 / cek error replikasi
Last active January 26, 2021 18:04
cek error replikasi, klo ada skip dan continue
@echo off
@mysql -u root -ppasswordnya -e "show slave status \G;" | findstr /C:"Slave_SQL_Running: No" > NUL
if %errorlevel%==0 (GOTO:skipit) else (goto:fine)
:skipit
echo Skip error replikasi
rem buat file log error replikasi
echo Ada error @ %date% %time% >> "h:\executables\errorreplikasi.txt"
@mysql -u root -ppassword -e "show slave status \G;" >> "h:\executables\errorreplikasi.txt"
mysql -u root -ppasswordnya -e "stop slave;SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;start slave;"
@agungsp2000
agungsp2000 / settimefromcurl.bat
Last active October 15, 2020 09:06
Set Windows local time from website header using CURL, need this because NTP is blocked cant do auto sync, use task scheduler to do this batch file recurringly
cls
echo off
rem Get date from google.com header and put it into file
@curl -s -I www.google.com | findstr "Date:" > datetime.txt
rem set variabel timenow as that file content, its in GMT so need to convert it into local timezone
@set /p timenow=< datetime.txt
@rem echo Jam GMT: %timenow%
rem Get the time only
@agungsp2000
agungsp2000 / index.php
Last active April 26, 2020 12:56
index.php pelajarandigital ke-2
<?php
$fromid = urldecode($_REQUEST['nomor']);
$txt = urldecode($_REQUEST['msg']);
$tcap=strtoupper($txt);
$tz_object = new DateTimeZone('Asia/Jakarta');
$datetime = new DateTime();
$datetime->setTimezone($tz_object);
(() => {
//
// GLOBAL VARS AND CONFIGS
//
var lastMessageOnChat = false;
var ignoreLastMsg = {};
var elementConfig = {
"chats": [0, 0, 5, 2, 0, 3, 0, 0, 0],
"chat_icons": [0, 0, 1, 1, 1, 0],
"chat_title": [0, 0, 1, 0, 0, 0, 0],