Skip to content

Instantly share code, notes, and snippets.

veganista

  • Manchester, UK
Block or report user

Report or block veganista

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
@veganista
veganista / OpenCartValetDriver.php
Created Oct 3, 2016
Laravel Valet Driver - OpenCart 2.x
View OpenCartValetDriver.php
<?php
class OpenCartValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
@veganista
veganista / recipe.md
Created Jul 15, 2016
WP CLI Commands
View recipe.md

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 / opencart.php
Created Jun 21, 2016
Get the path to a category in opencart 1.5.*
View opencart.php
<?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 / functions.php
Created May 9, 2016
Disable author pages in WordPress
View functions.php
/**
* 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 / file.liquid
Created Apr 20, 2016
Debugging Objects in Shopify Templates
View file.liquid
<script>console.log({{ product | json }});</script>
@veganista
veganista / SassMeister-input.scss
Created Jun 11, 2015
Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// 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 / SassMeister-input.scss
Created Apr 22, 2015
Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// Sass (v3.3.14)
// Compass (v1.0.1)
// ----
$alpha: (
color: "red"
);
@veganista
veganista / html.html
Created Feb 6, 2015
Simple Grid Layout
View html.html
<div class="list">
<div class="item">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Debitis vero architecto et at atque deserunt consectetur provident.</div>
<div class="item">Doloremque eveniet, repudiandae magni consequatur illum voluptatem,ad dolor.</div>
<div class="item">Odit nostrum excepturi. Aspernatur, expedita impedit perferendis, pariatur aliquam sed facilis.</div>
<div class="item">Cumque ipsam est </div>
<div class="item">Nulla maxime veritatis, ut eveniet. Nobis ut consequatur cumque nulla totam nisi obcaecati, iste aliquam dolore minus consectetur, magni veritatis? Neque id, harum expedita, natus quas voluptatibus et molestias soluta!</div>
<div class="item">Eveniet nostrum laudantium ea repellat voluptatem consectetur quis facere animi labore! Accusantium, pariatur possimus corporis quod placeat, doloribus eum labore velit maiores autem eius deserunt, inventore unde officiis consequatur quos.</div>
<div class="item">Minima veniam non quis nihil placeat recusandae id e
View Attachment.php
<?php
App::uses('MediaAppModel', 'Media.Model');
App::uses('Folder', 'Utility');
App::uses('File', 'Utility');
/**
* Attachment Model
*
*/
class Attachment extends MediaAppModel {
View gist:b581e04e2dd4a5e2c45d
Open a folder in termninal as a workspace then run....
$ mkdir app
$ cd app
$ touch composer.json
Add this to composer.json
{
You can’t perform that action at this time.