Skip to content

Instantly share code, notes, and snippets.

View farithadnan's full-sized avatar
:bowtie:
Exorcising

Farith farithadnan

:bowtie:
Exorcising
  • Malaysia
  • 20:20 (UTC +08:00)
View GitHub Profile
@farithadnan
farithadnan / date_duration.html
Last active March 20, 2021 22:17
Finding duration between two date. The calculation was made using JavaScript.
<div class="form-row" >
<div class="form-group col-sm-4">
<label class="font-weight-bold" for="pstatus">Estimated Start Date</label>
<input type="date" class="form-control form-control-sm" name="estStart" id="estStart" data-group="section-b1">
</div>
<div class="form-group col-sm-4">
<label class="font-weight-bold" for="ptype">Estimated End Date</label>
<input type="date" class="form-control form-control-sm" data-group="section-b1" name="estEnd" id="estEnd" placeholder="Please enter the estimated end date">
</div>
@farithadnan
farithadnan / temperature.java
Last active March 20, 2021 22:15
Temperature scanner using Java. Using condition to determine the different between suitable and bad temperature.
import java.util.Scanner;
import java.lang.String;
public class Covid
{
public static void main (String[] args)
{
double temperature = 0.0;
String[] name = new String[20];
@farithadnan
farithadnan / simple_insert.php
Last active March 20, 2021 22:16
Simple inserting data to DB with basic PHP.
<?php
if(isset($_POST['submit']))
{
$firstName = $_POST['firstName'];
$lastName = $_POST['lastName'];
$email = $_POST['email'];
$subject= $_POST['subject'];
$message = $_POST['message'];
@farithadnan
farithadnan / functions.php
Created March 20, 2021 22:35
Collection of functionality that can be use and implemented in the web development. This function's file originally used to develop a simple CMS with CRUD.
<?php
//============== DATABASE HELPER FUNCTION ==============//
// ----------------------------------------------------------//
// Function that wil redirect user to a specified path //
// ----------------------------------------------------------//
function redirect($location)
{
@farithadnan
farithadnan / en.php
Last active March 21, 2021 00:56
Simple multi-language features with PHP. This feature will let user change the language of a page based on their preference,
<?php
// English (Default) translation for registration page
const _REGISTER = "Register";
const _USERNAME = "Enter your username";
const _EMAIL = "Enter your email";
const _PASSWORD = "Enter your password";
?>
@farithadnan
farithadnan / 10_class_constructor_destructor.php
Created March 21, 2021 17:57
PHP OOP fundamental | Quick Refresh
<?php
// constructor is use to make PHP run the function automatically
// without instantied the function of a class.
class Cars {
public $wheel_count = 4;
static $door_count = 4;
// this is how to use constructor
function __construct(){
@farithadnan
farithadnan / upload.php
Created March 29, 2021 15:35
Basic uploading file with PHP
<?php
if (isset($_POST['submit'])) {
// Displaying the array detail of that files
// echo "<pre>";
// print_r($_FILES['file_upload']);
// echo "</pre>";
@farithadnan
farithadnan / input.component.html
Created May 9, 2021 07:26
Data Binding Exercise
<!--
ASSIGNMENT FOR DATABINDING
1. input, that use two way binding to
2. paragraph that will detect the update in name using string interpolation
3. button only clickable if the name is not empty, if its empty if will disable (use property binding)
4. button that can reset the string for variable, name
-->
<div class="container">
<!--
1. Add button that will be named as Display Details, will toggling secret message on and
off
2. paragraph will display the secret if the secret havent display yet, and
vise versa
3. Will display count of the evertime the button is click (Timestamp stored into an array), and save the timestamp to an array using loop
4. if the content is more than five. index wise, it will give blue background color and white as its font
-->
<div class="container">
@farithadnan
farithadnan / blur.css
Created September 30, 2021 04:29
Blur effect on a div element
div.blur {
-webkit-filter: blur(5px);
-moz-filter: blur(5px);
-o-filter: blur(5px);
-ms-filter: blur(5px);
filter: blur(5px);
width: 100px;
height: 100px;
background-color: #ccc;
}