Skip to content

Instantly share code, notes, and snippets.

View danemorgan's full-sized avatar

Dane Morgan danemorgan

View GitHub Profile
@danemorgan
danemorgan / mobile-ready-recaptcha.css
Created October 7, 2016 19:02
Make Google Recaptcha fit a typical mobile view #recaptcha #mobile #responsive
.g-recaptcha {
transform:scale(0.74);
-webkit-transform:scale(0.74);
transform-origin:0 0;
-webkit-transform-origin:0 0;
}
@danemorgan
danemorgan / mysql.service.txt
Created September 26, 2016 15:43
Starting, Stopping, & Restarting #MySQL on #Ubuntu 16.04 #linux #server From http://kb.solarvps.com/mysql/starting-stopping-and-restarting-mysql-on-ubuntu/
Start:
root@mypod:~# sudo /etc/init.d/mysql start
Stop:
root@mypod:~# sudo /etc/init.d/mysql stop
Restart:
root@mypod:~# sudo /etc/init.d/mysql restart
@danemorgan
danemorgan / SSH-WP-Install-commands
Last active May 21, 2018 17:14
Install WordPress via SSH
cd install-directory/
wget --no-check-certificate http://www.wordpress.org/latest.tar.gz
tar xfz latest.tar.gz
mv wordpress/* ./
rmdir ./wordpress/
rm -f latest.tar.gz
@danemorgan
danemorgan / not-home.scss
Last active August 29, 2015 14:10
Target all pages except home page with not selector in scss
/*
http://www.reddit.com/r/Wordpress/comments/2moqec/great_use_case_for_css_not_selector_when/
So I'm working on a client site just now and I was trying to think of the age old problem of how to do the page layout
(content | sidebar) without applying that same layout to the homepage. If your home page is set to a static page, you
can't use body.page{} because the home page is still technically a page.
You could overwrite all the styles for body.page.home{} but then you're repeating yourself. Then it hit me, use the
CSS :not pseudo selector!
@danemorgan
danemorgan / responsive-woo-cart.css
Created November 8, 2014 14:09
Make the Woocommerce table based cart responsive so that it works on mobile
/* START Make the cart table responsive */
/* http://css-tricks.com/responsive-data-tables/ */
/* http://cyberchimps.com/forum-topic/woocommerce-cart-page-still-doesnt-fit-on-mobile-2/page/2/ */
/* Force table to not be like tables anymore */
.woocommerce-page table.shop_table,
.woocommerce-page table.shop_table thead,
.woocommerce-page table.shop_table tbody,
.woocommerce-page table.shop_table th,
.woocommerce-page table.shop_table td,
.woocommerce-page table.shop_table tr {
@danemorgan
danemorgan / phpwidgets.php
Created September 24, 2014 17:30
Enable PHP in WordPress Widgets
// Enable PHP in widgets
add_filter('widget_text','execute_php',100);
function execute_php($html){
if(strpos($html,"<"."?php")!==false){
ob_start();
eval("?".">".$html);
$html=ob_get_contents();
ob_end_clean();
}
return $html;
@danemorgan
danemorgan / widget-shortcodes.php
Created September 24, 2014 17:28
Add shortcode capabilities to WordPress widgets
// Enable shortcodes in widgets
add_filter('widget_text', 'do_shortcode');
@danemorgan
danemorgan / wget.sh
Last active August 29, 2015 14:06 — forked from lyoshenka/wget.sh
wget --mirror --page-requisites --continue --convert-links --user-agent="" --execute robots=off --wait 1 URL
<?php
################################################################################
// Custom WordPress Local Config
// Use only for Development
// https://gist.github.com/bhubbard/8428583
################################################################################
/* Database Connection Info */
define('DB_NAME', '');
define('DB_USER', '');
For more details, see http://code.garyjones.co.uk/install-wordpress-ssh/
wget http://wordpress.org/latest.tar.gz
tar zxf latest.tar.gz
cd wordpress
cp -rpf * ../
cd ../
rm -rf wordpress/
rm -f latest.tar.gz