Skip to content

Instantly share code, notes, and snippets.

View Nil79's full-sized avatar

Nicola Sodano Nil79

View GitHub Profile
@Nil79
Nil79 / README.md
Created March 25, 2019 14:58
File CSV di import aliquote fiscali

Documentazione colonne:

  • Code: Titolo della regola
  • Country: Codice ISO a due caratteri del Paese di riferimento
  • State: Provincia (asterisco per indicare tutte le province)
  • Zip/Post Code: Codice CAP (asterisco per indicare tutte le destinazioni)
  • Rate: percentuale dell'aliquota
  • Zip/Post is Range: Se 1 considera un range di valori per il CAP (colonna facoltativa)
  • Range From/Range To: Valore iniziale e finale del range (colonna facoltativa)
  • Le colonne successive sono gli store code specificati in NEGOZIO > IMPOSTAZIONI > TUTTI I NEGOZI, colonna VISTA NEGOZIO: utili per localizzare il titolo della regola fiscale (Colonne facoltative)
@Nil79
Nil79 / MyScript.php
Created March 8, 2019 16:11
Magento2 - script to create a simple product programmatically
<?php
class MyScript
extends \Magento\Framework\App\Http
implements \Magento\Framework\AppInterface {
protected $_productRepository;
protected $_productFactory;
// Tramite la Dependcy Injection possiamo passare al costruttore delle classi Magento, diverse tipologie di classi
@Nil79
Nil79 / README.md
Created December 11, 2017 11:24
ADD CUSTOM BLOCK IN PRODUCT PAGE IN MAGENTO2

Add custom block in product page in Magento2

compatibility: Magento 2.2 (I haven't tested on earlier versions)

This gist shows how to show a custom block in the product view page in Magento2.

The files included in this gist are:

  • /app/design/frontend/YOURTHEME/PACKAGE/Magento_Catalog/layout/catalog_product_view.xml
  • /app/design/frontend/YOURTHEME/PACKAGE/Magento_Catalog/templates/product/view/myblock.phtml
@Nil79
Nil79 / Csv.php
Last active July 14, 2023 07:36
Add mass action in Order Grid in Magento 2.2
<?php
namespace Vendor\ModuleName\Controller\Adminhtml\Export;
use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection;
use Magento\Backend\App\Action\Context;
use Magento\Ui\Component\MassAction\Filter;
use Magento\Sales\Model\ResourceModel\Order\CollectionFactory;
@Nil79
Nil79 / sklabelnode_with_shadow.swift
Created April 26, 2016 14:57
SKLabelNode with Shadow (in Swift)
extension SKLabelNode {
convenience init?(fontNamed font: String, andText text: String, andSize size: CGFloat, withShadow shadow: UIColor) {
self.init(fontNamed: font)
self.text = text
self.fontSize = size
let shadowNode = SKLabelNode(fontNamed: font)
shadowNode.text = self.text
shadowNode.zPosition = self.zPosition - 1
shadowNode.fontColor = shadow
@Nil79
Nil79 / singleton.java
Last active August 29, 2015 13:55
Pattern Singleton Example
public class SingletonClass {
// The istance is available in shared memory
private static SingletonClass istance;
private SingletonClass() {}
public SingletonClass getIstance() {
if (istance == null) {
@Nil79
Nil79 / persistence.xml
Last active January 1, 2016 17:09
Persistence.xml file to connect cassandra database using kundera under jboss as
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="cassandra_pu">
<provider>com.impetus.kundera.KunderaPersistence</provider>
<class>com.example.Item</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
@Nil79
Nil79 / kundera_cassandra_cql3_0.java
Last active January 1, 2016 16:18
Using kundera to connect with Cassandra database through CQL3.0
/*
* This is just a reminder, if you are using cql3.0 for your keyspaces and tables.
* The example supposes that you are using kundera-cassandra ( https://github.com/impetus-opensource/Kundera ) to connect to your Cassandra database.
*
*/
protected EntityManagerFactory emf;
public List<User> findAll() {
emf = Persistence.createEntityManagerFactory("cassandra_pu");