Skip to content

Instantly share code, notes, and snippets.

View danielkwok21's full-sized avatar
💭
Do what you can; With what you have; While you can

Daniel Kwok danielkwok21

💭
Do what you can; With what you have; While you can
View GitHub Profile
<script>
const params = new URLSearchParams(window.location.search)
const halalButtonEl = document.getElementById("halalButton")
let isFilterHalal = false
if (isFilterHalal) {
toggleHalalButton(false)
} else {
toggleHalalButton(true)
curl "https://uat4.myeg.com.my/ETUKARMILIK/etukar/forgotPassword/nurzatulaqilah^@gmail.com" ^
-H "Connection: keep-alive" ^
-H "sec-ch-ua: ^\^" Not;A Brand^\^";v=^\^"99^\^", ^\^"Google Chrome^\^";v=^\^"97^\^", ^\^"Chromium^\^";v=^\^"97^\^"" ^
-H "Accept: application/json" ^
-H "Content-Type: application/json" ^
-H "sec-ch-ua-mobile: ?0" ^
-H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" ^
-H "sec-ch-ua-platform: ^\^"Windows^\^"" ^
-H "Origin: http://localhost:3000" ^
-H "Sec-Fetch-Site: cross-site" ^
@danielkwok21
danielkwok21 / Car.java
Created October 10, 2017 04:31
OOP example
public class Car {
public void drive(){
System.out.println("Vroom vroom");
}
public void honk(){
System.out.println("Honk Honk");
}
public void radio(){
System.out.println("Song Song");
@danielkwok21
danielkwok21 / potato.php
Last active June 19, 2018 08:19
Connected website + data from database
<!DOCTYPE html>
<?php
include 'index.php'; //connects website to database
?>
<link href="potato.css" rel="stylesheet" type="text/css" />
<html>
<head>
<h1>Hello potato</h1>
<p>It's a wonderful day</p>
@danielkwok21
danielkwok21 / potato.php
Created September 7, 2017 00:45
Fully connected website
<!DOCTYPE html>
<?php
include 'index.php'; //connects website to database
?>
<link href="potato.css" rel="stylesheet" type="text/css" />
<html>
<head>
<h1>Hello potato</h1>
<p>It's a wonderful day</p>
@danielkwok21
danielkwok21 / potato.css
Created September 5, 2017 01:47
Potato frontend files (separated)
h1{
color:red;
}
p{
color:blue;
}
div{
background:#98bf21;
height:100px;
width:100px;
@danielkwok21
danielkwok21 / potato.html
Last active September 5, 2017 01:48
Potato frontend combined files
<!DOCTYPE html>
<html>
<head>
<h1>Hello potato</h1>
<p>It's a wonderful day</p>
<div>Square</div>
</head>
@danielkwok21
danielkwok21 / db_connection.php
Last active September 2, 2017 11:45
php connection for potato
<?php
function opencon(){
$dbhost = "localhost";
$dbuser="root";
$dbpass=/*"insert your password here"*/;
$db=/*"insert your database name here. Mine's potato"*/;
$conn = new mysqli($dbhost, $dbuser, $dbpass, $db) or die("Connection failed: %s \n". $conn->error);
return $conn;