Skip to content

Instantly share code, notes, and snippets.

Wakhid Wichaksono wichaksono

View GitHub Profile
View anti-adsblock.txt
<script>
document.addEventListener('DOMContentLoaded', init, false);
function init(){
adsBlocked(function(blocked){
if(blocked){
var adblocker = document.getElementById('adblocker-detected');
adblocker.classList.add('show');
}
})
View function-two-digit.php
<?php
#.... ubah 4 jadi 04. dan seterusnya selama 1 digit, jika dua digit
# seperti 10, tidak akan berubah jadi 010 tapi tetap 10
function two_digit($string)
{
return sprintf('%02d', $string);
}
View countdown-time-complete.php
<?php
/**
* Sample Countdown Timer JS PHP
*/
$date_start = '10-10-2018 20:40:00';
$date_end = '11-10-2018 20:40:00';
$dateStart = new Datetime($date_start);
$dateEnd = new Datetime($date_end);
$interval = $dateStart->diff($dateEnd);
// var_dump( $intervale );
View countdown-timer.php
<?php
/**
* Sample Countdown Timer JS PHP
*/
$date_start = '10-10-2018 20:40:00';
$date_end = '11-10-2018 20:40:00';
$dateStart = new Datetime($date_start);
$dateEnd = new Datetime($date_end);
View tanpa-db.php
<?php
session_start();
require 'config.php';
if (
isset($_POST['username']) &&
$_POST['username'] == 'admin' &&
isset($_POST['password']) &&
$_POST['password'] == '12345'
) {
$_SESSION['user_login'] = 'admin';
View functions.php
<?php
/**
*/
require_once get_theme_file_path('class-list-member.php');
function addMenuMembers()
{
add_menu_page('Memberss', 'Memberss', 'manage_options', 'customer', 'MembersHtml');
}
add_action('admin_menu', 'addMenuMembers', 1);
View class-list-member.php
<?php
if ( ! class_exists('WP_List_Table') ) {
require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
}
/**
* Class memberLists Handle Table Lists
*/
class memberLists extends WP_List_Table
{
public function __construct()
@wichaksono
wichaksono / ob-map.js
Created May 13, 2018 — forked from pentagonal/ob-map.js
Resolve Google Map v3 without API Key
View ob-map.js
/*
* Resolve Google Map v3 without API Key
* since june 22 2016
* Put on body and load before map render
*/
(function (window) {
if (!window.document) {
return;
}
View taxonomy.php
<?php
/**
* Registrasi Taxonomy
*/
add_action( 'init', 'onphpid_taxonomy' , 0 );
function onphpid_taxonomy() {
// registrasi category product
register_taxonomy(
'product_category',
View .httaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
You can’t perform that action at this time.