Skip to content

Instantly share code, notes, and snippets.

View samazgor's full-sized avatar
🎯
Focusing

Sam Azgor samazgor

🎯
Focusing
View GitHub Profile
@samazgor
samazgor / A-Pen-by-Sam-Azgor.markdown
Created November 16, 2013 23:52
A Pen by Sam Azgor.
@samazgor
samazgor / WPTimehop
Last active March 4, 2016 08:35
Display your posts from this exact day in previous years in WordPress
/**
*
* Time Capsule By Sam Azgor
* Copy and paste the following code in your theme’s functions.php file
* Add this to your template - <?php wp_timehop_sam(); ?>
*
*/
function wp_timehop() {
$today = getdate();
@samazgor
samazgor / README.md
Created April 8, 2016 21:37 — forked from hofmannsven/README.md
Add WordPress admin menu pages with another Dashicon. (Note: This will require at least WordPress 3.8)
@samazgor
samazgor / crontab
Created December 24, 2018 20:55
default crontab file
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
@samazgor
samazgor / php-fpm.conf
Created May 9, 2020 19:55
php-fpm configuration file for v7.2
; sudo nano /etc/php/7.2/fpm/pool.d/digitechpoint.conf
; Start a new pool named 'digitechpoint'.
; the variable $pool can be used in any directive and will be replaced by the
; pool name ('digitechpoint' here)
[digitechpoint]
; Per pool prefix
; It only applies on the following directives:
; - 'access.log'
; - 'slowlog'
@samazgor
samazgor / nginx-wehost.conf
Last active July 22, 2021 18:47
nginx website block config sudo nano /etc/nginx/sites-available/samazgor.me
server {
listen 80;
listen [::]:80;
root /home/digitechpoint/apps/samazgor.me/public;
index index.php index.html index.htm;
server_name samazgor.me www.samazgor.me;
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
@samazgor
samazgor / .htaccess.md
Created August 13, 2020 14:33
redirect HTTP to HTTPS Using .htaccess

Redirecting HTTP to HTTPS

  1. Redirect All Web Traffic If you have existing code in your .htaccess, add the following:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]
@samazgor
samazgor / php7.4-fpm.conf
Created October 28, 2020 09:00
Custom php-fpm configuration file for v7.4
; sudo nano /etc/php/7.4/fpm/pool.d/digitechpoint.conf
; Start a new pool named 'digitechpoint'.
; the variable $pool can be used in any directive and will be replaced by the
; pool name ('digitechpoint' here)
[digitechpoint]
; Per pool prefix
; It only applies on the following directives:
; - 'access.log'
; - 'slowlog'
@samazgor
samazgor / .htaccess
Created July 30, 2021 15:17 — forked from NinjaPress/.htaccess
Evitando HotLinking via .htaccess no Wordpress (Exceto permitidos)
# Disable hotlinking of images with forbidden message
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?seu-dominio.com.br/.*$ [NC]
RewriteCond %{HTTP_REFERER} !search\?q=cache [NC]
RewriteCond %{HTTP_REFERER} !google\. [NC]
RewriteCond %{HTTP_REFERER} !yahoo\. [NC]
RewriteCond %{HTTP_REFERER} !googleusercontent\. [NC]
RewriteCond %{HTTP_REFERER} !bing\. [NC]
@samazgor
samazgor / performance.conf
Created October 6, 2022 01:04 — forked from JamiesonRoberts/performance.conf
Apache Security Headers Setup for Serverpilot
Header set Connection keep-alive
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType image/svg+xml "access 1 month"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"