Skip to content

Instantly share code, notes, and snippets.

Phil Banks emirpprime

Block or report user

Report or block emirpprime

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@emirpprime
emirpprime / Pure CSS Offsets
Last active Jul 23, 2019
CSS to add offsets to Pure grids http://purecss.io/
View Pure CSS Offsets
/*
Offsets from https://raw.githubusercontent.com/tilomitra/pure/d7f85e37abec3fdab14a541305ad05783159655c/src/grids/css/grids-offsets.css
Media queries from Pure v0.5.0
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
https://github.com/yui/pure/blob/master/LICENSE.md
*/
@media screen and (min-width: 35.5em) {
.offset-sm-0 {
margin-left:0;
@emirpprime
emirpprime / social.php
Created Aug 2, 2019
Basic social OG tag generation for WordPress
View social.php
<?php
/**
* Plugin Name: Social Test
*
* TODO: Output <meta name="twitter:site" content="@username" />? Needs custom option to read from.
* TODO: Custom option for social fallback image instead of core image?
*/
/**
* Adding the Open Graph schema definitions in the Language Attributes.
@emirpprime
emirpprime / products_with_category.sql
Last active Sep 7, 2019
Select Product name, SKU, price and category from WordPress / WooCommerce with MySQL query
View products_with_category.sql
SELECT
wp_posts.post_title AS Product,
wp_postmeta1.meta_value AS SKU,
wp_postmeta2.meta_value AS Price,
GROUP_CONCAT( wp_terms.name ORDER BY wp_terms.name SEPARATOR ', ' ) AS ProductCategories
FROM wp_posts
LEFT JOIN wp_postmeta wp_postmeta1
ON wp_postmeta1.post_id = wp_posts.ID
AND wp_postmeta1.meta_key = '_sku'
LEFT JOIN wp_postmeta wp_postmeta2
View wp.sh
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Do you need to setup new MySQL database? (y/n)"
read -e setupmysql
if [ "$setupmysql" == y ] ; then
echo "MySQL Admin User: "
read -e mysqluser
You can’t perform that action at this time.