Skip to content

Instantly share code, notes, and snippets.

View gegeriyadi's full-sized avatar
🏠
Working from home

Teguh Riyadi gegeriyadi

🏠
Working from home
View GitHub Profile
add_action ( 'after_setup_theme' , 'remove_core_updates' );
function remove_core_updates ()
{
if (! current_user_can ( 'update_core' )){ return ;}
add_action ( 'init' , create_function ( '$a' , "remove_action( 'Init', 'wp_version_check' );" ), 2 );
add_filter ( 'pre_option_update_core' , '__return_null' );
add_filter ( 'pre_site_transient_update_core' , '__return_null' );
}
remove_action ( 'load-update-core.php' , 'wp_update_plugins' );
add_filter ( 'pre_site_transient_update_plugins' , '__return_null' );
function remove_core_updates (){
global $wp_version ; return ( object ) array ( 'last_checked' => time (), 'version_checked' => $wp_version ,);
}
add_filter ( 'pre_site_transient_update_core' , 'remove_core_updates' );
add_filter ( 'pre_site_transient_update_plugins' , 'remove_core_updates' );
add_filter ( 'pre_site_transient_update_themes' , 'remove_core_updates' );
@gegeriyadi
gegeriyadi / CaptureFaceBookReaction.html
Created December 29, 2016 14:43 — forked from anburocky3/CaptureFaceBookReaction.html
Counts Facebook Reactions with Token and display in web page.
<!--
How to use:
1.Create a facebook application here https://developers.facebook.com/apps/
- Open https://developers.facebook.com/tools/explorer , select your Application , select your FB Page, and copy access token :
This is called as the short lived access token, and will be valid for 30min or 1 hour
- Then open https://graph.facebook.com/oauth/ac...=<app_secret>&fb_exchange_token=<short_token> (replace the values correctly) .
This will give out another access token. Copy that token correctly from the response. It will be something like:
@gegeriyadi
gegeriyadi / page.php
Created August 18, 2017 07:28
fix page layout kecebingit
<?php if (!defined('IS_IN_SCRIPT')) { die(); exit; } ?>
<?php get_header(); ?>
<div class="smart_content col-9-12">
<?php if (have_posts()) :?>
<?php while (have_posts()) : the_post(); ?>
<?php endwhile; ?>
<div class="box-checkout ongkircek">
<h2><?php the_title(); ?></h2>
<span class="meta-dt">Kategori <a href="<?php bloginfo('url');?>/blog" title="blog">Blog</a></span>
<?php the_content(); ?>
@gegeriyadi
gegeriyadi / Laravel PHP7 LEMP AWS.md
Created December 21, 2017 11:12 — forked from santoshachari/Laravel PHP7 LEMP AWS.md
Laravel 5.x on Ubuntu 16.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip

#STEP 1 Create a new laravel project. For more info, check the laravel docs page, on the laravel website

composer create-project laravel/laravel --prefer-dist my-laravel-app

#STEP 3 Install heroku toolbelt, on your machine. Assuming its ubuntu, just follow the following instructions Heroku toolbelt is a command line client, for heroku

@gegeriyadi
gegeriyadi / Best permission for wordpress directory (ubuntu 16.04) .md
Last active July 29, 2021 07:06
Best permission for wordpress directory (ubuntu 16.04)

Best permission for wordpress directory (ubuntu 16.04)

first, go to your wordpress path and then run this command

sudo chown www-data:www-data . -R
sudo find . -type d -exec chmod 755 {} \;
sudo find . -type f -exec chmod 644 {} \;

Simple script to check outgoing mail port is open or not

<?php

$host = 'smtp.sendgrid.net';
$ports = array(25, 587, 465);

foreach ($ports as $port)
{

To quickly and easily remove all unwanted comments when using Sublime text, perform a search and replace (CMD, ALT & D) and enter the following. Make sure that regex search is enabled by clicking the small icon in the bottom left that looks like an astrix.

For example, to remove all HTML comments:

(?s)<!--.*?-->

search and replace with blank

Or to remove all CSS comments: