Skip to content

Instantly share code, notes, and snippets.

View the7th's full-sized avatar

Abdul Rahman the7th

View GitHub Profile
@the7th
the7th / hiking-malaysia.csv
Created February 13, 2023 02:42 — forked from heiswayi/hiking-malaysia.csv
Senarai kedudukan Gunung/Bukit di Malaysia berdasarkan ketinggian untuk rujukan pendaki-pendaki gunung.
KEDUDUKAN NAMA GUNUNG/BUKIT LOKASI KETINGGIAN (m)
1 Gunung Kinabalu Sabah 4,095
2 Gunung Trusmadi Sabah 2,642
3 Gunung Tambuyukon Sabah 2,579
4 Gunung Murud Sarawak 2,422
5 Gunung Mulu Sarawak 2,376
6 Gunung Tahan Pahang 2,187
7 Gunung Korbu Perak 2,183
8 Gunung Yong Belar Sempadan Perak-Kelantan 2,181
9 Gunung Gayong Perak 2,173
@the7th
the7th / method.php
Created April 24, 2019 09:57
proof of payment
add_action( 'woocommerce_checkout_order_review', 'method_proof_of_payment', 10, 1 );
add_action( 'woocommerce_checkout_order_review', 'check_order', 10, 1 );
function method_proof_of_payment() {
echo "<script>
jQuery( document ).ajaxComplete(function() {
if(jQuery('#payment_method_cod').is(\":checked\")){
jQuery('label[for=\"wccf_checkout_field_proof_payment\"]').show();
@the7th
the7th / sanitize_phone_number_malaysia.php
Created June 5, 2018 15:19
Sanitize phone number for Malaysia
<?php
$prepare_phone_num = $phone_num;
$phone = $prepare_phone_num;
$phone = str_replace(["-", "–", " ", "+"], '', $phone);
if ("0" == substr($phone, 0, 1))
{
$phone = "6" . $phone;
}
@the7th
the7th / fpdf-image.php
Last active April 18, 2018 23:15 — forked from timneutkens/fpdf-image.php
Insert base64 image data into fpdf
<?php
// load the 'fpdf' extension
require('fpdf.php');
// just for demonstration purpose, the OP gets the content from a database instead
$h_img = fopen('img.jpg', "rb");
$img = fread($h_img, filesize('img.jpg'));
fclose($h_img);
// prepare a base64 encoded "data url"
@the7th
the7th / LimitController.php
Last active March 6, 2018 01:48
Laravel Eloquent LIMIT
<?php
// below is just a sample code
$specificProject = DB::table('projects')
->select('projects.id', 'projects.project_name', 'projects.progress_percent', 'projects.project_note_id', 'projects.project_status', 'project_notes.notes', 'project_timeline.start_date', 'project_timeline.end_date', 'assigned_project.id', 'assigned_project.project_assigned_to_user', 'users.name')
->join('project_notes', 'projects.id', '=', 'project_notes.project_id')
->join('project_timeline', 'projects.id', '=', 'project_timeline.project_id')
->join('assigned_project', 'projects.id', '=', 'assigned_project.project_id')
->join('users', 'assigned_project.project_assigned_to_user', '=', 'users.id')
->orderBy('project_notes.id', 'DESC')
@the7th
the7th / .gitignore
Last active August 15, 2017 02:20
gitignore for Gradle based Project in IntelliJ
# Cache of project
.gradletasknamecache
# Ignore Gradle GUI config
gradle-app.setting
## File-based project format:
*.iws