Skip to content

Instantly share code, notes, and snippets.

😀
Always happy deving away :D

Daniel Coull danrcoull

😀
Always happy deving away :D
View GitHub Profile
@danrcoull
danrcoull / M2Menu2Boostrap.js
Created Jan 26, 2017
Magento 2 Standard Category Menu to Boostrap menu without changing templates
View M2Menu2Boostrap.js
/**
* 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 Dec 9, 2016
_bootstrap_variables.scss
View _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 Nov 23, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// 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 Nov 22, 2016
Bootstrap Equalizer to reset the size of elements responsivly
View Bootstrap-Equalizer.js
/**
* Equalizer Plugin
* Author: Daniel Coull <d.coull@suttonsilver.co.uk>
* 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 Nov 15, 2016
replace merge with the name of the branch you wish to replace master with.
View git-replacemaster.sh
git checkout merge
git merge -s ours master
git checkout master
git merge merge
@danrcoull
danrcoull / squash-images-cli.sh
Last active Oct 25, 2016
bash Compress recursivly all images
View squash-images-cli.sh
#!/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 Oct 25, 2016
Install Magento 1.X - and Base level Modules via Modman using composer
View install.sh
#!/usr/bash
composer install
@danrcoull
danrcoull / Foundation6-MenuToDropdown.js
Last active Oct 24, 2016
Convert standard Foundation 6 Menu to dropdown menu on small screens on the fly.
View Foundation6-MenuToDropdown.js
## 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 <ttechitsolutions@gmail.com>
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 Nov 18, 2016
Foundation 6 - Convert Tabs to Accordion on small Screens.
View Foundation6-TabToAccordion.js
## Description Add the below To any Foundation 6 theme and change the iniialUlClass to whatever your tab ul class is.
## Author : Daniel Coull <ttechitsolutions@gmail.com>
var tabsToAccordian = {
initialUlClass: '.easytabs',
accordian: null,
tabs:null,
View php-fpm-cli
#!/bin/bash
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Mathias Leppich <mleppich@muhqu.de>
#
# 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
You can’t perform that action at this time.