Skip to content

Instantly share code, notes, and snippets.

View danrcoull's full-sized avatar
😀
Always happy deving away :D

Daniel Coull danrcoull

😀
Always happy deving away :D
View GitHub Profile
@danrcoull
danrcoull / M2Menu2Boostrap.js
Created January 26, 2017 16:42
Magento 2 Standard Category Menu to Boostrap menu without changing templates
/**
* Magento 2 Menu to Boostrap 3 - Requires Boostrap.js and Boostrap-submenu.js (https://github.com/vsn4ik/bootstrap-submenu)
* @type {{_init: createMenu._init, _addHamburger: createMenu._addHamburger, _addWrappers: createMenu._addWrappers, _modifyToggle: createMenu._modifyToggle, _hookEvents: createMenu._hookEvents, _destroy: createMenu._destroy}}
*/
var createMenu =
{
hamburger:false,
id:'navbar',
_init : function(hamburger,id) {
@danrcoull
danrcoull / _bootstrap_variables.scss
Last active December 9, 2016 11:15
_bootstrap_variables.scss
@function palette($palette, $tone: 'base') {
@return map-get(map-get($palettes, $palette), $tone);
}
$palettes: (
cls-main-blue: (
base: rgb(#043678),
light: rgb(lighten(#043678,10%)),
dark: rgb(darken(#043678,10%))
),
@danrcoull
danrcoull / 0_reuse_code.js
Created November 23, 2016 09:59
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@danrcoull
danrcoull / Bootstrap-Equalizer.js
Last active November 22, 2016 16:16
Bootstrap Equalizer to reset the size of elements responsivly
/**
* Equalizer Plugin
* Author: Daniel Coull <[email protected]>
* Setup For bootstrap and simple, just pass an id or class to init.
* Works great with catalog names, responsive.
*/
var equalizer = {
window: jQuery(window),
element: null,
bp: {
@danrcoull
danrcoull / git-replacemaster.sh
Created November 15, 2016 12:36
replace merge with the name of the branch you wish to replace master with.
git checkout merge
git merge -s ours master
git checkout master
git merge merge
@danrcoull
danrcoull / squash-images-cli.sh
Last active October 25, 2016 20:01
bash Compress recursivly all images
#!/bin/bash
cd $1
find . -iname '*.jp*g' -type f -print0 | xargs -0 jpegoptim -o --strip-all --max=80
find . -iname '*.png' -type f -print0 | xargs -0 pngquant --quality=70-80
find . -iname '*.png' -type f -print0 | xargs -0 optipng -o7 strip all
@danrcoull
danrcoull / install.sh
Last active October 25, 2016 19:35
Install Magento 1.X - and Base level Modules via Modman using composer
#!/usr/bash
composer install
@danrcoull
danrcoull / Foundation6-MenuToDropdown.js
Last active October 24, 2016 21:53
Convert standard Foundation 6 Menu to dropdown menu on small screens on the fly.
## Convert standard Foundation 6 Menu to dropdown menu on small screens on the fly.
## Great for ecommerce like Magento 1.9 / 2.0
## Author: Daniel Coull <[email protected]>
var topLinksMobile = {
topLinks: null,
topLinksWrapper: null,
topLinkWrap:'<ul class="dropdown menu top-links-wrapper" data-dropdown-menu><li></li></ul>',
topLinkBefore: '<a href="" class="cust-menu">Customer Menu</a>',
@danrcoull
danrcoull / Foundation6-TabToAccordion.js
Last active November 18, 2016 16:09
Foundation 6 - Convert Tabs to Accordion on small Screens.
## Description Add the below To any Foundation 6 theme and change the iniialUlClass to whatever your tab ul class is.
## Author : Daniel Coull <[email protected]>
var tabsToAccordian = {
initialUlClass: '.easytabs',
accordian: null,
tabs:null,
@danrcoull
danrcoull / php-fpm-cli
Created February 10, 2016 13:10 — forked from muhqu/php-fpm-cli
#!/bin/bash
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Mathias Leppich <[email protected]>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell