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
server {
listen 80;
listen [::]:80;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
server_name _;
@gegeriyadi
gegeriyadi / AND_OR_NOT
Created September 26, 2018 09:20 — forked from oliverdoetsch/AND_OR_NOT
Blogger: Globally conditional data tags for all page types
#AND
<b:if cond='data:blog.pageType == "index"'>
<b:if cond='data:blog.searchQuery'>
<!--search_page AND index_page-->
</b:if>
</b:if>
#OR

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:

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)
{
@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 {} \;

#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 / 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
@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 / 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: