Skip to content

Instantly share code, notes, and snippets.

View codekipple's full-sized avatar

codekipple

View GitHub Profile
@codekipple
codekipple / 4.gif
Last active April 10, 2019 23:32
so I wrote
4.gif
@codekipple
codekipple / 5.gif
Last active April 10, 2019 23:31
a long one instead.
5.gif
@codekipple
codekipple / gist:ef7083e595f4cd81eff464398e1798a7
Created May 31, 2017 14:22
Magento modal UI 'clickableOverlay' problem
/*
Close modal because the 'clickableOverlay' method is broken on Magentos modal
Look into fixing this globally and submitting a patch
https://github.com/magento/magento2/issues/7399
*/
$(document).mouseup(function(e) {
var container = $('.my-modal .modal-inner-wrap');
// if the target of the click isn't the container nor a descendant of the container
if (!container.is(e.target) && container.has(e.target).length === 0)
@codekipple
codekipple / image-role.php
Last active May 10, 2017 09:58
Mangento 2, adding a new image role
<?php
// the group name has to be 'Image Management' rather than 'Image' as it has to match the 'attribute_group_code' rather than the 'attribute_group_name' in the 'eav_attribute_group' table.
// See convertToAttributeGroupCode() in \Magento\Eav\Setup\EavSetup
$this->eavSetup->addAttribute(
\Magento\Catalog\Model\Product::ENTITY,
'test_image_role',
[
'group' => 'Image Management',
'type' => 'varchar',
'frontend' => 'Magento\Catalog\Model\Product\Attribute\Frontend\Image',
@codekipple
codekipple / dabblet.css
Created September 4, 2013 16:28 — forked from renoirb/dabblet.css
Lea Verou's CSS Lightbox, taken on webplatform.org
/**
* Lea Verou's CSS Lightbox, taken on webplatform.org
* For redistribution purposes
* @author Lea Verou <lea@w3.org>
*/
.modal {
visibility: hidden;
position: fixed;
top: 50%;
left: 50%;
@codekipple
codekipple / dabblet.css
Created September 4, 2013 16:17
css modal
/**
* css modal
*/
.modal {
text-align: center;
}
.modal__content {
padding: 2em;
display: inline-block;
@codekipple
codekipple / prefixed event
Created August 6, 2013 13:58
js function for doing cross browser event listeners
var PrefixedEvent = function(element, type, callback) {
var pfx = ["webkit", "moz", "MS", "o", ""];
for (var p = 0; p < pfx.length; p++) {
if (!pfx[p]) type = type.toLowerCase();
element.addEventListener(pfx[p]+type, callback, false);
}
}
@codekipple
codekipple / sass structure
Last active December 19, 2015 21:39
CSS Stratagem
- base
- functions
- mixins
- variables
- fonts
- breakpoints
- reset
- helpers
- type
@codekipple
codekipple / gist:4285311
Created December 14, 2012 12:58
Command line snippets
cal 12 2012 #display a visual calender
dscacheutil -flushcache #clear your DNS Cache.
@codekipple
codekipple / i really wanna see those dangleys
Created December 13, 2012 10:40
Git command to find dangling commits
git fsck --lost-found