Skip to content

Instantly share code, notes, and snippets.

@facelordgists
facelordgists / mysql_splitdump.sh
Last active August 29, 2015 13:57 — forked from jasny/mysql_splitdump.sh
Split a mysql dump into a single file per table
#!/bin/bash
####
# Split MySQL dump SQL file into one file per table
# based on http://blog.tty.nl/2011/12/28/splitting-a-database-dump
####
if [ $# -lt 1 ] ; then
echo "USAGE $0 DUMP_FILE [TABLE]"
exit
@facelordgists
facelordgists / python-install.md
Created March 13, 2014 05:07
How to install Python 3 on Mac

How to install Python 3 on Mac

brew install pyenv
pyenv init
pyenv install 3.3.3

pyenv local 3.3.3

@facelordgists
facelordgists / web-server-diagnostics.md
Created May 3, 2014 19:04
Linux Web Server performance analysis and troubleshooting

Analyze performance

Logs

Monitor several pertinent logs simultaneously in real-time

ls -drt /var/log/* | tail -n5 | xargs sudo tail -n0 -f

HTTP connections

@facelordgists
facelordgists / magnific-review-pro-popup.css
Created October 31, 2014 03:28
Magnific Popup code for RSMM Review Pro button
////////////////////////////////////////
// Review Pro Popup Formatting
.review-pro-popup-content {
padding-top: 100%;
padding-top: 925px;
}
.mfp-iframe-holder .mfp-content {
max-width: 620px;
}
///////////////////////////////////////
@facelordgists
facelordgists / scrollable-full-width-image.js
Created November 2, 2014 16:46
Magnific Popup Full Width Image w/ scrolling
jQuery(function($) {
$('.image-popup-full-width').magnificPopup({
type: 'image',
closeOnContentClick: true,
image: {
verticalFit: false
}
});
});
@facelordgists
facelordgists / shell-argument-processing.sh
Created January 29, 2015 00:02
How to process dash arguments
while getopts ":a:" opt; do
case $opt in
a)
echo "-a was triggered, Parameter: $OPTARG" >&2
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
:)
@facelordgists
facelordgists / mobile-with-classes.less
Last active August 29, 2015 14:17
Mobile width classes
// MAX WIDTH CLASSES
// ******************
// Mobile
@media (max-width: 767px){
a[class*=m-maxw-]{
display: inline-block;
}
.m-maxw-100p { max-width:100% !important}
.m-maxw-90p { max-width:90% !important}
.m-maxw-80p { max-width:80% !important}
@facelordgists
facelordgists / less-color-classes.less
Last active August 29, 2015 14:17
Use LESS to generate class selectors for text, background, border, and link using a mixin.
@color-primary: #f50;
@color-secondary: #ccf;
@pumpkin: #fa7500;
#theme-color-mixin(@color, @class) {
.@{class}{color: @color}
.@{class}i{color: @color !important}
.@{class}-bg{background-color:@color}
.@{class}-bgi{background-color:@color !important}
@facelordgists
facelordgists / factory-2.0-field-definitions.json
Created March 18, 2015 22:53
Factory 2.0 DMS field definitions
{"fields":[
{
"title":"Icon",
"token":"icon",
"type":"select_icon",
"help":"Font Awesome Icon",
"default":"fa fa-heart"
},
{
"title":"Heading",
@facelordgists
facelordgists / sms-v2-changelog.md
Created March 26, 2015 19:48
DMS SMS v2 Changelog

Changelog

2.1.0 [03/25/2015]

  • Disabled Redux Dev Mode
  • Fixed issue with changelog markdown that caused the first line to have a bunch of extra space, which was converted into a chunk of code.
  • BUG FIX Magnific JS Generator section now creates a unique class ID if none is specified. Fixes the JS error that would occur if no ID was specified.
  • BUG FIX Backgrounds with fixed positioning set on the band style will only stretch to cover the screen at the mobile breakpoint if the background-size property is set to "cover". Fixes issue with repeating backgrounds.
  • Magnific JS Generator section now combines all js code into one script tag, rather than a seperate script tag for each iteration.
  • NEW FEATURE: Save with keyboard. Press Control + s (PC) or Command + s to save the post.