Skip to content

Instantly share code, notes, and snippets.

View jauhari's full-sized avatar
😇

Jauhari jauhari

😇
View GitHub Profile
#!/bin/bash
# put cron every 15 minutes. Change my login, or you can use this
sleep 3
curl --request POST --insecure -d "dst=&popup=true&username=1234qwer%40melsahotspot.com&password=1234" https://login.melsahotspot.com/login
curl --insecure --request GET --referer "http://melsahotspot.com/promo/advert/http:login.melsahotspot.com/status" http://login.melsahotspot.com/status
@jauhari
jauhari / style.css
Created December 13, 2016 16:31
Sample Child Theme WordPress style.css
/*
Theme Name: Ponjong
Theme URI: http://www.jauhari.net/themes
Description: Desa Berkemajuan
Author: Nurudin Jauhari
Author URI: http://nurudin.jauhari.net
Template: twentyseventeen
Version: 1.2.3
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@jauhari
jauhari / functions.php
Created December 13, 2016 16:33
Sample Simple Child Theme WordPress
<?php
function my_theme_enqueue_styles() {
$parent_style = 'parent-style'; // This is 'twentyfifteen-style' for the Twenty Fifteen theme.
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style',
get_stylesheet_directory_uri() . '/style.css',
array( $parent_style ),
wp_get_theme()->get('Version')
/*-----------------------------------------------------------------------------------*/
/* Breadcrumbs with Google Frienldy Rich Snippet Tools
/*-----------------------------------------------------------------------------------*/
if (!function_exists('redwaves_breadcrumb')) {
function redwaves_breadcrumb() {
echo '<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><i class="fa fa-home"></i> <a itemprop="item" href="';
echo home_url();
echo '"><span itemprop="name">'.sprintf( __( "Home","redwaves-lite"));
echo '</span></a></li>';
if (is_category() || is_single()) {
/*-----------------------------------------------------------------------------------*/
/* Breadcrumbs
/*-----------------------------------------------------------------------------------*/
if (!function_exists('redwaves_breadcrumb')) {
function redwaves_breadcrumb() {
echo '<div><i class="fa fa-home"></i></div> <div typeof="v:Breadcrumb" class="root"><a rel="v:url" property="v:title" href="';
echo home_url();
echo '">'.sprintf( __( "Home","redwaves-lite"));
echo '</a></div><div>'.__('<i class="fa fa-caret-right"></i>','redwaves-lite').'</div>';
if (is_category() || is_single()) {
<div class="breadcrumb">
<ul itemscope itemtype="http://schema.org/BreadcrumbList">
<?php redwaves_breadcrumb(); ?>
</ul>
</div>
.breadcrumb {
position: relative;
display: block !important;
font-size: 12px;
margin-bottom: 10px;
}
.breadcrumb ul {
padding: 0;margin: 0;list-style:none;
display: block;
}
@jauhari
jauhari / add custom style css on wordpress
Last active February 20, 2017 11:58
Added Custom CSS on WordPress that support Live Preview and bypass any Cache system
<?php
add_action( 'wp_enqueue_scripts', 'idnme' );
function idnme() {
wp_enqueue_style( 'idnme', get_stylesheet_directory_uri() . '/me.css'.get_the_date_hash('Y-m-d His'), array() );
}
function the_date_hash($param = 'Y-m-d H:i:s')
{
echo get_the_date_hash($param);
}
@jauhari
jauhari / remove image and wp-caption WordPress
Last active February 20, 2017 11:58
Remove Image and wp caption on Content Frontpage WordPress
<?php
function dhw_remove_img($content) {
if (!is_single()):
// REMOVE IMAGE ONLY $content = preg_replace("/<img[^>]+\>/i", "", $content);
$content = preg_replace("#\s*\[caption[^]]*\].*?\[/caption\]\s*#is", "", $content);
endif;
return $content;
}
add_filter( 'the_content', 'dhw_remove_img' );
@jauhari
jauhari / 0_reuse_code.js
Created April 7, 2017 22:04
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console