Skip to content

Instantly share code, notes, and snippets.


Ash Smith ashsmith

Block or report user

Report or block ashsmith

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
ashsmith / Controller-Edit.php
Last active Aug 28, 2019
M2 module from scratch - p5 - adminhtml
View Controller-Edit.php
namespace Ashsmith\Blog\Controller\Adminhtml\Post;
use Magento\Backend\App\Action;
class Edit extends \Magento\Backend\App\Action
* Core registry
ashsmith /
Created Mar 27, 2019 — forked from benok/
Enable "ps [-p|--pid] PID" for /bin/ps from busybox (like Alpine Linux)
# enable "ps [-p] PID" for /bin/ps from busybox (like Alpine)
# copy this script as /usr/local/bin/ps or /usr/bin/ps, and chmod 755 it.
if [ $# == 1 ]; then
echo $1 | grep -q -E '^[0-9]+$' # number only argument
if [ $? == 0 ]; then
ashsmith / gist:524d176eaf48bfd87aab
Created Feb 18, 2015
Fake your user agent to look like Googlebot.
View gist:524d176eaf48bfd87aab
curl -A "'Mozilla/5.0 (compatible; Googlebot/2.1; +')" http://MYDOMAIN.COM/ --head
View track_disqus_comments_with_ga
var disqus_config = function() {
this.callbacks.onNewComment.push(function() {
ga('send', {
'hitType': 'event', // Required.
'eventCategory': 'comments', // Required.
'eventAction': 'comment', // Required.
'eventLabel': 'New Comment'
View Import mysql file
/Applications/MAMP/Library/bin/mysql -u [username] -p databasename < file.sql
#You will be prompted for the users password after
View modman install
cd /to/magento/root/
modman init
modman clone
ashsmith / default_2.1.vcl
Created Apr 21, 2013
Varnish Cache for Magento configuration..
View default_2.1.vcl
# This configuration is what is provided by PageCache by Varnish for Magento module:
# default backend definition. Set this to point to your content server.
backend default {
.host = "";
.port = "80";
# admin backend with longer timeout values. Set this to the same IP & port as your default server.
ashsmith / update_order_numbers_1.sql
Last active Nov 8, 2017
Magento: Update Order Numbers SQL
View update_order_numbers_1.sql
-- Update Order increment id to start at 123456789
UPDATE `eav_entity_store` SET `increment_last_id` = '123456789' WHERE `entity_type_id` = '5';`
-- Update Invoice increment id to start at 123456789
UPDATE `eav_entity_store` SET `increment_last_id` = '123456789' WHERE `entity_type_id` = '6';
-- Update Credit Memo increment id to start at 123456789
UPDATE `eav_entity_store` SET `increment_last_id` = '123456789' WHERE `entity_type_id` = '7';
-- Update Shipment increment id to start at 123456789
ashsmith / local.xml
Created Oct 9, 2012
Remove popular search terms page from Google Index.
View local.xml
<?xml version="1.0" encoding="UTF-8"?>
<reference name="head">
<action method="setRobots"><value>NOINDEX,NOFOLLOW</value></action>
ashsmith / post-receive
Created Sep 1, 2012
Git push to server, remote repo hook to automatically update a website's filesystem
View post-receive
GIT_WORK_TREE=$WEBDIR git checkout -f
You can’t perform that action at this time.