Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Hasan Basri hasanbasri1993

🏠
Working from home
View GitHub Profile
View server_side_status.php
<?php
if (!isset($_GET['id'])) {
die("Anda tidak dizinkan mengakses langsung script ini!");
} else {
if ($_GET['id'] <> '76310EEFF2B5D3C887F238976A421B638CFEB0942AB8249CD0A29B125C91B3E5') {
die("Anda tidak dizinkan mengakses langsung script ini!");
}
}
include "../config/config.default.php";
include "../config/config.function.php";
@hasanbasri1993
hasanbasri1993 / index.php
Created May 14, 2020
cari bari code ini
View index.php
var autoRefresh = setInterval(
function () {
$('#divstatusall').load("<?= $homeurl ?>/admin/statuspeserta.php?id?id=76310EEFF2B5D3C887F238976A421B638CFEB0942AB8249CD0A29B125C91B3E5"");
}, 2000
);
@hasanbasri1993
hasanbasri1993 / index.php
Created May 14, 2020
replace dengan ini
View index.php
let status_exam = $('#tablestatus').DataTable({
"serverSide": true,
"stateSave": true,
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "kabehlah"]],
"ajax": "<?= $homeurl ?>/admin/server_side_status.php?id=76310EEFF2B5D3C887F238976A421B638CFEB0942AB8249CD0A29B125C91B3E5"
});
setInterval(function () {
status_exam.ajax.reload();
}, 1000);
View selesai.php
<?php
require("config/config.default.php");
require("config/config.function.php");
require("config/functions.crud.php");
$idm = $_POST['id_mapel'];
$ids = $_POST['id_siswa'];
$idu = $_POST['id_ujian'];
$where = array(
'id_mapel' => $idm,
View ulang dan selesai
function selesaikan_ujian(id) {
swal({
title: 'Apa anda yakin?',
text: "aksi ini akan menyelesaikan secara paksa ujian yang sedang berlangsung!",
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes!'
}).then((result) => {
if (result.value) {
View blynk-macOs-media-control.js
#!/usr/bin/env node
const Blynk = require('blynk-library');
const applescript = require('applescript');
const AUTH = '';
const blynk = new Blynk.Blynk(AUTH);
const volume = new blynk.VirtualPin(0)
const play = new blynk.VirtualPin(1)
const next = new blynk.VirtualPin(2)
@hasanbasri1993
hasanbasri1993 / read_float.js
Last active Nov 14, 2020
Membaca 32 bit Float Dari MODBUS Menggunakan NodeRed
View read_float.js
msg.payload = [0, 16833]; // hapus ini untuk melihat menkorvensi dari modbus
let pay = msg.payload; // mengambil data dari modbus
const buf = Buffer.allocUnsafe(4);
buf.writeInt16BE(pay[0],2);
buf.writeInt16BE(pay[1],0);
msg.payload = buf.readFloatBE(0);
return msg;
@hasanbasri1993
hasanbasri1993 / unifi-backup.sh
Last active Nov 30, 2020 — forked from corny/unifi-backup.sh
Improved backup script for Ubiquiti UniFi controller
View unifi-backup.sh
#!/bin/bash -e
#
# Improved backup script for Ubiquiti UniFi controller
# original source: http://wiki.ubnt.com/UniFi#Automated_Backup
#
# must contain:
username=YOUR_USERNAME
password=YOUR_PASSWORD
View tripay_create
function tripay_create($postData = false)
{
$order_items = [];
$post = $postData ? $postData : $this->request->getPost();
$apiKey = $this->apiKey;
$privateKey = $this->privateKey;
$merchantRef = $post['id_order'];
$amount = $post['biaya'] + 5000;
$method = $post['metode_bayar'];
if (isset($post['data']) and !isset($post['id_takhosus'])) {
View gist:bb5785ca0e3cab73ddf5f2e8d161f45b
# Configuration for telegraf agent
[agent]
## Default data collection interval for all inputs
interval = "1s"
## Rounds collection interval to 'interval'
## ie, if interval="10s" then always collect on :00, :10, :20, etc.
round_interval = true
## Telegraf will send metrics to outputs in batches of at most
## metric_batch_size metrics.