Skip to content

Instantly share code, notes, and snippets.

View brankoajzele's full-sized avatar

Branko Ajzele brankoajzele

View GitHub Profile
@brankoajzele
brankoajzele / script.bash
Created August 21, 2020 09:01
Recursively replace spaces with underscores in file name
find pub/media/catalog/product -depth -name '* *' -type f | while IFS= read -r f ; do mv -i "$f" "$(dirname "$f")/$(basename "$f"|tr ' ' _)" ; done
warden env exec -- -T php-fpm bin/magento setup:install \
--cleanup-database \
--backend-frontname=backend \
--amqp-host=rabbitmq \
--amqp-port=5672 \
--amqp-user=guest \
--amqp-password=guest \
--consumers-wait-for-messages=0 \
--db-host=db \
--db-name=magento \
@brankoajzele
brankoajzele / operatorCharacters.swift
Created September 2, 2017 19:44 — forked from natecook1000/operatorCharacters.swift
Allowed characters for Swift operators
import Foundation
extension UnicodeScalar : ForwardIndexType {
public func successor() -> UnicodeScalar {
return UnicodeScalar(value + 1)
}
}
var operatorHeads: [UnicodeScalar] = Array("=-+!*%<>&|^~?".unicodeScalars)
operatorHeads += Array("\u{00A1}" ... "\u{00A7}")
@brankoajzele
brankoajzele / docker-compose.yml
Last active July 14, 2017 18:20
docker-compose.yml
version: '3'
services:
mysql:
image: mysql:5.7
volumes:
- mysql_data:/var/lib/mysql
restart: always
ports:
- "3306:3306"
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
set_time_limit(0);
$chapters = glob('./chapters/*.html');
$dom = new DOMDocument;
@brankoajzele
brankoajzele / template-list.xml
Created October 11, 2016 09:53
find vendor/magento/. -name 'email_templates.xml' -exec grep -i 'template id=' {} \; > email_templates.list.txt
<template id="checkout_payment_failed_template" label="Payment Failed" file="failed_payment.html" type="html" module="Magento_Checkout" area="adminhtml"/>
<template id="contact_email_email_template" label="Contact Form" file="submitted_form.html" type="text" module="Magento_Contact" area="adminhtml"/>
<template id="customer_create_account_email_template" label="New Account" file="account_new.html" type="html" module="Magento_Customer" area="frontend"/>
<template id="customer_create_account_email_no_password_template" label="New Account Without Password" file="account_new_no_password.html" type="html" module="Magento_Customer" area="frontend"/>
<template id="customer_create_account_email_confirmation_template" label="New Account Confirmation Key" file="account_new_confirmation.html" type="html" module="Magento_Customer" area="frontend"/>
<template id="customer_create_account_email_confirmed_template" label="New Account Confirmed" file="account_new_confirmed.html" type="html" module="Magento_Customer" area="fro
foreach ($items as $delta => $item) {
// suppress all children so this field is not rendered
if ($field['type'] == 'list_boolean') {
$classes_array[] = drupal_html_class($field['settings']['allowed_values'][$item['value']]);
}
elseif ($field['type'] == 'taxonomy_term_reference') {
$tids[] = $item['tid']; //store the terms ids and just do taxonomy_term_load_multiple once at the end
}
else {
$classes_array[] = drupal_html_class($item['value']);
@brankoajzele
brankoajzele / gist:174a0d8fcef62584a17e
Created October 1, 2015 12:05
Magento - date as default sort order in Magento admin area
public function __construct()
{
parent::__construct();
$this->setDefaultSort('picking_date');
$this->setDefaultDir('ASC');
$today = new DateTime;
$this->setDefaultFilter(array(
'picking_date' => array(
'from' => $today->format('d/m/Y'),
@brankoajzele
brankoajzele / gist:fc3a20ffc9a64de24610
Created August 12, 2015 05:55
Magento 2 - full JavaScript list across entire Magento installation
app/code/Magento/AdminNotification/view/adminhtml/requirejs-config.js
app/code/Magento/AdminNotification/view/adminhtml/web/system/notification.js
app/code/Magento/AdminNotification/view/adminhtml/web/toolbar_entry.js
app/code/Magento/Authorizenet/view/adminhtml/web/js/direct-post.js
app/code/Magento/Authorizenet/view/frontend/requirejs-config.js
app/code/Magento/Authorizenet/view/frontend/web/js/view/payment/authorizenet.js
app/code/Magento/Authorizenet/view/frontend/web/js/view/payment/method-renderer/authorizenet-directpost.js
app/code/Magento/Backend/view/adminhtml/web/js/bootstrap/editor.js
app/code/Magento/Braintree/view/adminhtml/requirejs-config.js
app/code/Magento/Braintree/view/adminhtml/web/js/cc-data.js
<style>
#current-category-content ul {
padding-left: 20px;
}
.elastic-active-category-title span {
color: silver;
}
</style>
<div class="block block-list block-current-category">