Skip to content

Instantly share code, notes, and snippets.

View ppassmannpriv's full-sized avatar
🎯
Focusing

Pieter Paßmann ppassmannpriv

🎯
Focusing
View GitHub Profile
@ppassmannpriv
ppassmannpriv / dl.js
Created April 5, 2018 08:48
get all fancybox images as downloadlinks
jQuery('a.ngg-fancybox').each(function() {
var imageLink = jQuery(this);
var downloadLink = "<a style='padding: 20px; background: hotpink; color: white;' href='"+imageLink.attr('href')+"' download>Download this image</a>"
imageLink.parent().append(downloadLink);
});
@ppassmannpriv
ppassmannpriv / create_mage19_admin_user.sql
Created January 5, 2017 11:24
Create a new admin user account in Magento 1.9.2.4
LOCK TABLES `admin_role` WRITE , `admin_user` WRITE;
SET @SALT = "rp";
SET @PASS = CONCAT(MD5(CONCAT( @SALT , "test1234") ), CONCAT(":", @SALT ));
SELECT @EXTRA := MAX(extra) FROM admin_user WHERE extra IS NOT NULL;
INSERT INTO `admin_user` (firstname,lastname,email,username,password,created,lognum,reload_acl_flag,is_active,extra,rp_token_created_at)
VALUES ('Firstname','Lastname','email@domain.com','admin',@PASS,NOW(),0,0,1,@EXTRA,NOW());
INSERT INTO `admin_role` (parent_id,tree_level,sort_order,role_type,user_id,role_name)
@ppassmannpriv
ppassmannpriv / catexport.php
Created August 3, 2016 10:20
Export all Magento Categories with Name, ID
<?php
require_once 'app/Mage.php';
Mage::app();
$_categories = Mage::getModel('catalog/category')
->getCollection()
->addAttributeToSelect('*');
$_file = __DIR__."/categories.csv";
$_export = fopen($_file, 'w') or die('Permission denied - check filesettings');
@ppassmannpriv
ppassmannpriv / Sidenavi.html
Created May 19, 2016 15:05
Fluid sidenavi contentelement.
<div xmlns="http://www.w3.org/1999/xhtml" lang="en"
xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers"
xmlns:flux="http://typo3.org/ns/FluidTYPO3/Flux/ViewHelpers"
xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers">
<f:layout name="Content" />
<f:section name="Configuration">
<flux:form id="sidenavi" options="{group: 'FCE'}">
<!-- Insert fields, sheets, grid, form section objects etc. here, in this flux:flexform tag -->
{namespace flux=FluidTYPO3\Flux\ViewHelpers}
{namespace v=FluidTYPO3\Vhs\ViewHelpers}
<f:layout name="Content"/>
<f:section name="Configuration">
<flux:form id="gridBuilder" options="{group: 'Layout', icon: '{f:uri.resource(path: \'Icons/ext_icon.gif\')}'}">
<!-- Grid Select -->
<flux:field.select name="layout" items="{1: '12x1', 2: '6x2', 3: '4x3', 4: '3x4', 5: '5x5', 6: '4+8', 7: '3+9', 8: '6+6', 9: '1x12'}" default="0" />
<!-- Grid-builder -->
@ppassmannpriv
ppassmannpriv / fixorders.php
Created September 29, 2015 11:55
Small php script which will reassign orders to the correct customers
<?php
require_once('../../app/Mage.php'); //Path to Magento
umask(0);
Mage::app();
error_reporting(E_ALL);
ini_set('display_errors', 1);
ini_set('max_execution_time', 3000);
echo '<pre>';
@ppassmannpriv
ppassmannpriv / jquery.scrollToElement.js
Created August 10, 2015 12:32
jQuery Scroll to Element function.
function scrollToElement(element, speed)
{
$('html, body').animate({
scrollTop: element.offset().top
}, speed);
return false;
}
@ppassmannpriv
ppassmannpriv / mageInstall
Last active August 29, 2015 14:26
Install Magento v1910
#!/bin/bash
clear
stty erase '^?'
echo -n "Database Name: "
read DBNAME
echo -n "Database User: "
@ppassmannpriv
ppassmannpriv / opc_optimized.css
Created January 27, 2015 14:54
Improved Magento OPC - original: h-o.nl - optimized for rwd by scriptkid.de
/* ======================= Improved One Page Checkout with tabs ======================== */
.checkout-onepage-index .col-main { width: 100%; padding:0; }
.block-progress .block-title { background:none; margin:0 0 34px; padding:0; }
.checkout-onepage-index .col-main { padding:0; border:0; }
.checkout-onepage-index .page-title { padding-right:40px; width:auto; }
.checkout-onepage-index .page-title h1 { background:none; padding:0; }
.opc { position:relative; overflow:hidden; height:970px; }
.opc .buttons-set { margin:15px 0 0; opacity:1!important; }
@ppassmannpriv
ppassmannpriv / Data.php
Created March 11, 2013 13:49
Yay fun Resize an image wherever you want with this fun and nice dandy helper in Magento.
<?php
/**
* @author Pieter Paßmann @ graphodata AG 2013
* @website graphodata.de
* @description Resize any image with your own helper.
*/
class Graphodata_Resizeimg_Helper_Data extends Mage_Core_Helper_Abstract
{
/**