Skip to content

Instantly share code, notes, and snippets.

Avatar

Paulo Elias pauloelias

View GitHub Profile
View favicons.html
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="/apple-touch-icon-152.png">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/apple-touch-icon-144.png">
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="/apple-touch-icon-120.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/apple-touch-icon-114.png">
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="/apple-touch-icon-76.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/apple-touch-icon-72.png">
<link rel="apple-touch-icon-precomposed" sizes="60x60" href="/apple-touch-icon-60.png">
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="/apple-touch-icon-57.png">
<link rel="apple-touch-startup-image" href="/apple_startup_image.png">
<link rel="icon" type="image/png" href="/favicon-16.png" sizes="16x16">
@pauloelias
pauloelias / ExpressionEngine "Edit This" Link
Last active Dec 28, 2017
ExpressionEngine "Edit Entry" link. Place this in your channel entries output to provide a direct link to edit the entry in the control panel.
View ExpressionEngine "Edit This" Link
@pauloelias
pauloelias / .htaccess
Created Aug 24, 2012 — forked from MaxLazar/.htaccess
ExpressionEngine .htaccess template
View .htaccess
# Standard .htaccess file
# Secure .htaccess file
<Files .htaccess>
order allow,deny
deny from all
</Files>
# Don't show any directory without an index file
Options -Indexes
@pauloelias
pauloelias / README.md
Created Aug 23, 2012
Extended ExpressionEngine .htaccess/apache conf
View README.md

ExpressionEngine .htaccess/Apache conf

Please use these at your own risk. I cannot be responsible for having no idea what I am doing and breaking your server.

This is a collection of Apache configuration settings that I use in my ExpressionEngine projects. Since I have always been a big fan of the HTML5 Boilerplate I took inspiration from their .htaccess file and tweaked my configuration with other settings I have used over the years.

This gist contains:

  • _EXTENDED.htaccess This is a general .htaccess file I rename and edit as needed for each site. Note: When I host a site on my prad/stage/dev servers I move most or all of these rules into the vhost.conf file
  • _SAMPLE.httpd.conf I use Ubuntu on my development, staging, and production servers so this is specific to Apache 2 on my setup. Essentially this file extends the apache2.conf (in my setup).
@pauloelias
pauloelias / _SIMPLE.htaccess
Created Aug 23, 2012
Simple ExpressionEngine .htaccess
View _SIMPLE.htaccess
# Standard ExpressionEngine Apache Configuration (.htaccess)
# httpd.apache.org/docs/2.2/mod/quickreference.html
# ------------------------------
# SECURITY: Secure "dot" files/directories
# ------------------------------
# Block access to "hidden" directories or files whose names begin with a
# period. This includes directories used by version control systems such as
# Subversion or Git.
# <IfModule mod_rewrite.c>
View eecms_variable_prefixes.txt
Variable prefixes are handy:
cf_ = custom field
sn_ = snippet
gv_= global variable
pr_ = preload replace
category_ = category custom
@pauloelias
pauloelias / wget-mirror-site.sh
Last active Oct 7, 2015
Mirror a site with wget
View wget-mirror-site.sh
# http://www.gnu.org/software/wget/manual/wget.html
# OPTIONS: -m mirror, -k convert-links, -w delay (in seconds) between requests
wget -mk -w1 http://domain.tld/
View mamp-mysql-import.sh
/Applications/MAMP/Library/bin/mysql -u root -p cli_database < /path/to/cli_dump.sql
View bulk-rename-delete.sh
# Review the offending files.
find /path/to/files -name '*:*' -print
# Delete the offending files.
find /path/to/files -name '*:*' -exec rm {} +
# Rename the offending files with an underscore.
find /path/to/files -name '*:*' -exec rename ':' '_' {} +
# For a more efficient version of delete some UNIX variants support (this avoids the need to fork and exec /bin/rm for every single matching file).
@pauloelias
pauloelias / .gitignore
Created Jul 17, 2012
.gitignore – Ignore all files in dir. Useful for quickly adding empty directories (E.G. cache directories etc. but ignoring dirs/files underneath)
View .gitignore
# Ignore everything in this directory
*
# Except this file
!.gitignore
You can’t perform that action at this time.