Skip to content

Instantly share code, notes, and snippets.

@veganista
veganista / SassMeister-input.scss
Created June 11, 2015 11:11
Generated by SassMeister.com.
// ----
// libsass (v3.2.4)
// ----
$_gridle-version: "1.0.0";
$gridle-settings : "{";
$gridle-settings : "#{$gridle-settings} \"version\" : \"#{$_gridle-version}\"";
$gridle-settings : "#{$gridle-settings} }";
#gridle-settings {
@veganista
veganista / file.liquid
Created April 20, 2016 10:56
Debugging Objects in Shopify Templates
<script>console.log({{ product | json }});</script>
@veganista
veganista / functions.php
Created May 9, 2016 09:06
Disable author pages in WordPress
/**
* Disable author pages
*/
add_action( 'template_redirect', function(){
global $wp_query;
if ( is_author() && !is_404() ) {
$wp_query->set_404();
status_header( 404 );
nocache_headers();
}
@veganista
veganista / opencart.php
Created June 21, 2016 10:35
Get the path to a category in opencart 1.5.*
<?php
/**
* Returns the path to a category in the format 1_2_3
* @param int $category_id
* @return string the path to the category
*/
public function getCategoryPath($category_id){
$path = '';
@veganista
veganista / recipe.md
Created July 15, 2016 10:34
WP CLI Commands

Assign all post thumbnail to a specific attachment

wp post list --post_type=post --format=ids | tr ' ' '\n' | xargs -I % wp post meta add % _thumbnail_id {{ATTACHMENT_ID}}

@veganista
veganista / OpenCartValetDriver.php
Created October 3, 2016 08:30
Laravel Valet Driver - OpenCart 2.x
<?php
class OpenCartValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri