Skip to content

Instantly share code, notes, and snippets.

Avatar

Jon Munson jonmunson

View GitHub Profile
@jonmunson
jonmunson / disable-anchor.css
Created Oct 17, 2013
Disable links using CSS
View disable-anchor.css
#home nav .home > a {
pointer-events: none;
cursor: default;
}
@jonmunson
jonmunson / tinymce-disable-p-tags
Created Oct 16, 2013
TinyMCE - disable <p> tags, use <br> instead
View tinymce-disable-p-tags
<script type="text/javascript" src="/js/tinymce/tinymce.min.js'"></script>
<script type="text/javascript">
tinymce.init({
selector: "textarea",
forced_root_block : false,
force_p_newlines : false,
remove_linebreaks : false,
force_br_newlines : true,
remove_trailing_nbsp : false,
@jonmunson
jonmunson / _ie8-grid-fix
Last active Dec 24, 2015 — forked from tmayr/gist:5190565
ZURB Foundation 4 - IE8 Fixes
View _ie8-grid-fix
/* The Grid ---------------------- */
.lt-ie9 .row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row.large-collapse .column,
.lt-ie9 .row.large-collapse .columns { padding: 0; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row .row.large-collapse { margin: 0; }
.lt-ie9 .column, .lt-ie9 .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; }
.lt-ie9 .column.large-centered, .columns.large-centered { float: none; margin: 0 auto; }
@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 / 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 / .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 / 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/