Skip to content

Instantly share code, notes, and snippets.

Chris Jones leek

Block or report user

Report or block leek

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
@leek
leek / deploy.sh
Last active Jun 17, 2019
Magento 2 Deployment Script
View deploy.sh
#!/bin/bash
LOCKFILE=deploy.lock
if [ -e ${LOCKFILE} ] && kill -0 `cat ${LOCKFILE}`; then
echo "-- ERROR"
echo "-- Deployment is already running"
exit
fi
@leek
leek / README.md
Last active Jan 15, 2020
Magento 2 - Delete All Test Data
View README.md

These set of scripts are for Magento 2. For Magento 1, see this Gist.

@leek
leek / homestead.md
Last active Dec 18, 2018
Instructions for setting up and using Homestead
View homestead.md

Homestead Setup

  1. (Mac Only) Install Homebrew:

     /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    
  2. (Mac Only) Install Caskroom:

     brew tap caskroom/cask
    
View ConfigServiceProvider.php
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class ConfigServiceProvider extends ServiceProvider
{
/**
* Overwrite any vendor / package configuration.
@leek
leek / fizzbuzz.js
Created Sep 9, 2014
FizzBuzz solutions in various languages.
View fizzbuzz.js
for (var i = 1; i <= 100; i++) {
if (i % 15 === 0) {
console.log('FizzBuzz');
} else if (i % 3 === 0) {
console.log('Fizz');
} else if (i % 5 === 0) {
console.log('Buzz');
} else {
console.log(i);
}
View Ultimate_Gulpfile.md

Includes:

  • Configuration
  • BrowserSync
  • Environments (e.g.,: --environment=production)
  • Image optimization (gif, jpg, png, and svg)
  • Sass compilation with external libraries
  • Bower installed Sass libraries example(s)
  • CSS processing with Pleeease
View disable_pointer_events.js
/**
* Disable and enable event on scroll begin and scroll end.
* @see http://www.thecssninja.com/javascript/pointer-events-60fps
*/
(function(r, t) {
window.addEventListener('scroll', function() {
// User scrolling so stop the timeout
clearTimeout(t);
// Pointer events has not already been disabled.
if (!r.style.pointerEvents) {
View DownloadsController.php
<?php
namespace app\controllers;
use app\models\Downloads;
class DownloadsController extends \lithium\action\Controller {
public function index() {
$this->request->privateKeys = array('id', 'user_id');
@leek
leek / reset_permissions.sh
Created Sep 30, 2013
Magento - Simple reset file permissions script
View reset_permissions.sh
#!/bin/bash
#
# Found on StackOverflow:
# http://stackoverflow.com/a/9304264/3765
#
if [ ! -f ./app/etc/local.xml.template ]; then
echo "-- ERROR"
echo "-- This doesn't look like a Magento install. Please make sure"
echo "-- that you are running this from the Magento main doc root dir"
@leek
leek / magento_urls.sql
Created Jul 8, 2013
Magento: Fix Hardcoded URL's in Database
View magento_urls.sql
UPDATE cms_block SET content = REPLACE(content, "http://www.example.com/", "{{store url=''}}");
UPDATE cms_page SET content = REPLACE(content, "http://www.example.com/", "{{store url=''}}");
--
-- AW_Blog Only
--
UPDATE aw_blog SET post_content = REPLACE(post_content, 'http://www.example.com/', "{{store url=''}}");
You can’t perform that action at this time.