Skip to content

Instantly share code, notes, and snippets.

View snowfluke's full-sized avatar
❄️
Loving snow and Yukinoshita Yukino

Awal Ariansyah snowfluke

❄️
Loving snow and Yukinoshita Yukino
View GitHub Profile
<!-- php -->
include 'koneksi.php';
include 'sesi.php';
$query = "SELECT (SELECT COUNT(*) FROM tb_siswa) as total_siswa, (SELECT COUNT(*) FROM tb_buku) as total_buku, (SELECT COUNT(*) FROM tb_pinjam) as total_pinjam, (SELECT COUNT(*) FROM tb_kembali) as total_kembali";
$sql = mysqli_query($conn, $query);
$result = mysqli_fetch_assoc($sql);
<div class="container-fluid">
<div class="header-body">
@snowfluke
snowfluke / request-handler.js
Last active October 16, 2022 13:47
A firend's code to refactor
const axios = require("axios");
const Endpoint = process.env.ENDPOINT;
const ApiKey = process.env.APIKEY;
export default async function handler(req, res) {
try {
const { username, password } = JSON.parse(req.body);
if (req.method !== "POST") return res.status(500).json("Method not allowed");
@snowfluke
snowfluke / gist:3af3ee5d8480f626884ea600ccc5d86e
Created December 20, 2022 23:18
React Native Clean Command
rm -r android/build;
rm -r android/app/src/release/res;
rm -r android/app/build/intermediates;
watchman watch-del-all;
rm -rf $TMPDIR/react-*;
yarn start -- --reset-cache
<?php
$questions = array(
array(
'question' => 'Soal 1',
'prompt' => 'gitar : ... ≈ ... : pukul',
'options' => array(
'A' => 'bernyanyi tukang',
'B' => 'kayu besi',
'C' => 'petik jimbe',
'D' => 'musik paku',
<?php
// Mendata semua question dlu, dan di sisi server supaya tidak diinspect element data-correctnya
// type a = soal biasa
// type b = soal tabel
$questions =[
[
'type' => 'a',
'correct_answer' => 'c',
'prompt' => 'gitar : ... ≈ ... : pukul',
'options' =>[
<html>
<head>
<title>Lorem</title>
<style>
body {
margin: 0;
padding: 0;
background-color: #e1e1e1;
}
<?php
require_once "db_connect.php";
session_start();
if (!isset($_SESSION['id_user'])) {
header("Location: login.php");
exit();
}
require "questions.php";
if (!isset($_SESSION['jawaban'])) {
$_SESSION['jawaban'] = array();