Skip to content

Instantly share code, notes, and snippets.

Avatar

Jon Munson jonmunson

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am jonmunson on github.
  • I am jonmunson (https://keybase.io/jonmunson) on keybase.
  • I have a public key ASCyXh8bPuIdNQf08yXQY7WH9bC4O-PwzV101feiryxXAgo

To claim this, I am signing this object:

@jonmunson
jonmunson / apache2.conf
Created Apr 16, 2017
Apache2 settings for optimum security - /etc/apache2/apache2.conf
View apache2.conf
<Directory /var/www/>
Options FollowSymLinks
AllowOverride None
Require all granted
Header always append X-Frame-Options SAMEORIGIN
Header set X-XSS-Protection "1; mode=block"
Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure
FileETag None
RewriteEngine On
RewriteCond %{THE_REQUEST} !HTTP/1\.1$
View ga-not-track-logged-in-users.php
<?php wp_footer(); ?>
<?php if (!$user_ID) : ?>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-9669661-12']);
_gaq.push(['_trackPageview']);
@jonmunson
jonmunson / prefetchbuilder.js
Created Dec 3, 2015 — forked from PaulKinlan/prefetchbuilder.js
Code to return link rel=dnsprefetch
View prefetchbuilder.js
(function() {
var requests = window.performance.getEntries();
var hosts = {};
var output = "";
for(var requestIdx = 0; requestIdx < requests.length; requestIdx++) {
var request = requests[requestIdx];
var origin = new URL(request.name).origin;
hosts[origin] = 1;
View maintain_magento_logs.sql
TRUNCATE dataflow_batch_export;
TRUNCATE dataflow_batch_import;
TRUNCATE log_customer;
TRUNCATE log_quote;
TRUNCATE log_summary;
TRUNCATE log_summary_type;
TRUNCATE log_url;
TRUNCATE log_url_info;
TRUNCATE log_visitor;
TRUNCATE log_visitor_info;
@jonmunson
jonmunson / .gitignore
Last active Aug 29, 2015 — forked from carlosasin/.gitignore
Git ignore Magento (ignore .htaccess for NGINX)
View .gitignore
# Ignore PHPStorm
/.idea/
/.phpstorm.meta.php
#Ignore vagrant
/.vagrant/
# Ignore code coverage reports
/build/
@jonmunson
jonmunson / permission.sh
Last active Aug 29, 2015 — forked from carlosasin/permission.sh
Magento - Repair permissions
View permission.sh
#!/bin/sh
sudo find . -type f -exec chmod 644 {} \;
sudo find . -type d -exec chmod 755 {} \;
sudo chmod o+w var app/etc
sudo chmod 550 mage
sudo chmod -R o+w media
@jonmunson
jonmunson / vertical-align.scss
Created Jun 23, 2015
Vertical align anything with just 3 lines of CSS
View vertical-align.scss
// Source: http://zerosixthree.se/vertical-align-anything-with-just-3-lines-of-css/
/* Mixin */
@mixin vertical-align {
position: relative;
top: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}
@jonmunson
jonmunson / mysqldump-remote.sh
Created Mar 9, 2015
mysqldump all databases from remote host
View mysqldump-remote.sh
mysqldump -h 1.2.3.4 -u username -p --all-databases > database_backup.sql
@jonmunson
jonmunson / wget-ftp.sh
Last active Aug 29, 2015
wget command to download directory via ftp
View wget-ftp.sh
wget -m --user=yourusername --password=yourpassword ftp://www.ftphost.co.uk:21/directory/
You can’t perform that action at this time.