Skip to content

Instantly share code, notes, and snippets.

View felipepodesta's full-sized avatar
👨‍💻
Stairway To Heaven

Felipe Podestá felipepodesta

👨‍💻
Stairway To Heaven
View GitHub Profile
@felipepodesta
felipepodesta / schema-org-structured-data-markup-using-microdata.html
Created January 26, 2018 07:07 — forked from milanaryal/schema-org-structured-data-markup-using-microdata.html
An example of how to mark up a HTML5 webpage using the schema.org schemas and microdata.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Site Title</title>
<link rel="stylesheet" href="/assets/css/style.min.css">
@felipepodesta
felipepodesta / nginx.conf
Created January 26, 2018 05:32 — forked from josephspurrier/nginx.conf
Nginx sub folder configuration for Trailing Slash Solution - http://josephspurrier.com/trailing-slash-solution/
location @testrewrites {
# Send all requests to index.php
rewrite ^ /test/index.php last;
}
# Else use this location block
location ~* ^/test/.*\.php$ {
# Strip subdir index.php and query string
if ( $request_uri ~* ^/(.*)/index\.php\?+) {
rewrite (?i)^/(.*)/index\.php /$1/? permanent;
@felipepodesta
felipepodesta / SSLXampp.md
Created January 25, 2018 21:17 — forked from nguyenanhtu/SSLXampp.md
Guide to configure SSL in XAMPP for Windows

How to test 'https' in XAMPP for localhost ? I will guide you

Menu

  • Create certificate
  • Config Apache to access https instead of http
  • Config mod rewrite to generate SSL url
  • Config Virtual host to test site

Step 1 : Create certificate

  • Go to your XAMPP installation directory (in my case it’s E:\xampp), figure out apache folder. In this, find & run batch file
@felipepodesta
felipepodesta / gist:1e98398aecaafa2e5793743a200742c9
Created December 15, 2017 06:23 — forked from bashilbers/gist:9d650facb7ac07d95aad
Web application performance tuning

Clientside profiling (ABSOLUTE MUST)

You can either:

  • Do it yourself:
    • Hook into the Navigation and Resource timing API
    • Emit requests to a static nginx webserver
    • The nginx server should return a 200 empty response
    • Parse the access_log with logstash
    • Monitor the performance with graphite
  • Or, use a SaaS ($$$), e.g.
  • Soasta
@felipepodesta
felipepodesta / changeEncodingFromNEWToOLDInMySQL.sh
Last active October 30, 2017 18:56 — forked from karlazz/change encoding from new to old in mysql
Change encoding from NEW to OLD in MySQL
sed -ie 's/utf8mb4_unicode_520_ci/utf8_general_ci/g' mysql.sql
sed -ie 's/CHARSET=utf8mb4/CHARSET=utf8/g' mysql.sql
sed -ie 's/utf8mb4_unicode_ci/utf8_general_ci/g' mysql.sql
@felipepodesta
felipepodesta / plugin-enabler.sh
Created July 18, 2017 20:52 — forked from fordnox/plugin-enabler.sh
Enable cache plugin for wordpress
#install wp-cli on server https://github.com/wp-cli/wp-cli
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
#install cache plugin to wordpress
curl -O https://raw.githubusercontent.com/bluehost/endurance-page-cache/master/endurance-page-cache.php
#activate plugin
@felipepodesta
felipepodesta / nginx-blacklist.conf
Created April 27, 2017 22:35 — forked from apisznasdin/nginx-blacklist.conf
This file implements a blacklist for certain user agents and referrers. It's a first line of defense. It must be included inside a http block in nginx configuration file.
### This file implements a blacklist for certain user agents and
### referrers. It's a first line of defense. It must be included
### inside a http block.
# based from https://github.com/perusio/piwik-nginx/blob/master/blacklist.conf
# blacklist from http://perishablepress.com/2013-user-agent-blacklist/
## Add here all user agents that are to be blocked.
map $http_user_agent $bad_bot {
default 0;
@felipepodesta
felipepodesta / gist:3ae5266053117e5be67ab6f2aad045f3
Created April 27, 2017 17:54 — forked from pnommensen/gist:707b5519766ba45366dd
Ghost CMS with NGINX for Maximum Performance

Full blog post can be found here: http://pnommensen.com/2014/09/07/high-performance-ghost-configuration-with-nginx/

Ghost is an open source platform for blogging founded by John O'Nolan and Hannah Wolfe. It's a node.js application and therefore works great in conjunction with nginx. This guide will will help you create a high performance nginx virtual host configuration for Ghost.

"Don't use #nodejs for static content" - @trevnorris. If #nginx isn't sitting in front of your node server, you're probably doing it wrong.

— Bryan Hughes (@nebrius) August 30, 2014
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>

The node.js application runs on a port on your server

@felipepodesta
felipepodesta / all_http_headers__separated_by_comma.txt
Created November 11, 2016 15:49
All HTTP Headers (Several Formats Of The Both Most-Common And The Exotic HTTP-Headers, Including Some From Google-Servers And WebSockets)
Accept,Accept-CH,Accept-Charset,Accept-Datetime,Accept-Encoding,Accept-Ext,Accept-Features,Accept-Language,Accept-Params,Accept-Ranges,Access-Control-Allow-Credentials,Access-Control-Allow-Headers,Access-Control-Allow-Methods,Access-Control-Allow-Origin,Access-Control-Expose-Headers,Access-Control-Max-Age,Access-Control-Request-Headers,Access-Control-Request-Method,Age,Allow,Alternates,Authentication-Info,Authorization,C-Ext,C-Man,C-Opt,C-PEP,C-PEP-Info,CONNECT,Cache-Control,Compliance,Connection,Content-Base,Content-Disposition,Content-Encoding,Content-ID,Content-Language,Content-Length,Content-Location,Content-MD5,Content-Range,Content-Script-Type,Content-Security-Policy,Content-Style-Type,Content-Transfer-Encoding,Content-Type,Content-Version,Cookie,Cost,DAV,DELETE,DNT,DPR,Date,Default-Style,Delta-Base,Depth,Derived-From,Destination,Differential-ID,Digest,ETag,Expect,Expires,Ext,From,GET,GetProfile,HEAD,HTTP-date,Host,IM,If,If-Match,If-Modified-Since,If-None-Match,If-Range,If-Unmodified-Since,Keep-Alive,La
@felipepodesta
felipepodesta / convert-gifs.sh
Created November 11, 2016 04:21 — forked from shazow/convert-gifs.sh
Batch convert a directory of gifs into mp4
#!/usr/bin/bash
# Convert *.gif into *.mp4, skip if already exists.
outdir="."
for path in *.gif; do
out="${outdir}/${path/.gif/}.mp4"
[[ -f "$out" ]] && continue
ffmpeg -f gif -i "${path}" "${out}"
done