Skip to content

Instantly share code, notes, and snippets.

@6ui11em
6ui11em / css-pure-font-family
Created December 11, 2013 09:40
CSS: Pure set font-family
body,
.pure-g [class *= "pure-u"],
.pure-g-r [class *= "pure-u"] {
/* Set your content font stack here: */
font-family: Georgia, Times, "Times New Roman", serif;
}
@6ui11em
6ui11em / jquery-valign-middle.js
Created December 11, 2013 17:46
JQuery: vAlign middle
(function ($) {
$.fn.vAlign = function() {
return this.each(function(i){
var h = $(this).height();
var oh = $(this).outerHeight();
var mt = (h + (oh - h)) / 2;
$(this).css("margin-top", "-" + mt + "px");
$(this).css("top", "50%");
$(this).css("position", "absolute");
});
@6ui11em
6ui11em / jquery-smooth-scroll.js
Created December 11, 2013 20:20
JQuery: Smooth Scroll
$('.scrollto').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
|| location.hostname == this.hostname) {
var hashStr = this.hash.slice(1);
var target = $(this.hash);
target = target.length ? target : $('[name=' + hashStr +']');
if (target.length) {
$('html,body').animate({ scrollTop: target.offset().top - 20}, 500);
window.location.hash = hashStr;
@6ui11em
6ui11em / css-boilerplate-media-queries.css
Created December 11, 2013 20:36
CSS: boilerplate media queries
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-width : 320px)
and (max-width : 480px) {
/* Styles */
}
/* Smartphones (landscape) ----------- */
@media only screen
and (min-width : 321px) {
@6ui11em
6ui11em / javascript-get-query-string-params.js
Created December 12, 2013 09:13
Javascript: Get query string params
function getQueryVariable(variable)
{
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if(pair[0] == variable){return pair[1];}
}
return(false);
}
@6ui11em
6ui11em / css-retina-media-queries.css
Created December 13, 2013 08:11
CSS: Retina media queries
@media only screen and (min-width: 320px) {
/* Small screen, non-retina */
}
@media
only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( min--moz-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( -o-min-device-pixel-ratio: 2/1) and (min-width: 320px),
@6ui11em
6ui11em / magento2_reset_customer_password.sql
Last active March 18, 2021 11:53
Magento2 reset customer password #magento2 #mysql
UPDATE `customer_entity`
SET `password_hash` = CONCAT(SHA2('xxxxxxxxYOURPASSWORD', 256), ':xxxxxxxx:1')
WHERE `entity_id` = 1;
-- REST Customer & Admin password
SET @pass = '123123q'; -- pone el pass q mas te guste
SET @salt = MD5(UNIX_TIMESTAMP());
UPDATE admin_user SET password = CONCAT(SHA2(CONCAT(@salt, @pass), 256), ':', @salt, ':1');
UPDATE customer_entity SET password_hash= CONCAT(SHA2(CONCAT(@salt, @pass), 256), ':', @salt, ':1');
@6ui11em
6ui11em / diable_foreig_keys.sql
Created November 28, 2017 11:53
Disable / enable foreig keys #mysql
SET foreign_key_checks = 0;
SET foreign_key_checks = 1;
# GLOBAL DISABLE
SET GLOBAL FOREIGN_KEY_CHECKS=0;
SET GLOBAL FOREIGN_KEY_CHECKS=1;
@6ui11em
6ui11em / magento2_change_core_config_data_urls.sql
Created November 28, 2017 12:38
Magento2 change core_config_data urls #magento2 #mysql
UPDATE core_config_data SET value='___YOUR_NEW_URL____' WHERE path LIKE '%base_url%';
@6ui11em
6ui11em / magento2_disable_https.sql
Created November 28, 2017 12:40
Magento2 disable secure https #magento2 #mysql
update core_config_data set value = 0 where path = 'web/secure/use_in_frontend';
update core_config_data set value = 0 where path = 'web/secure/use_in_adminhtml';