Skip to content

Instantly share code, notes, and snippets.

View mhauri's full-sized avatar

Marcel Hauri mhauri

View GitHub Profile
docker run -p 8834:8834 -e ACTIVATION_CODE=3A9D-4CG8-QU54-32WE-95TP -e USERNAME=admin -e PASSWORD=admin tenable/nessus:latest-ubuntu
<?php
namespace Demo\Navigation\Plugin\Layer;
use Magento\Catalog\Model\ResourceModel\Layer\Filter\Attribute;
use Magento\Framework\App\RequestInterface;
use Magento\Catalog\Model\Layer\Filter\ItemFactory;
use Magento\Catalog\Model\Category;
use Magento\Catalog\Model\Layer\FilterList;
use Magento\Catalog\Model\Product;
@mhauri
mhauri / gatsby-config.js
Last active October 27, 2020 19:07
Tree Extension for gatsby-remark-prismjs
// In your gatsby-config.js
plugins: [
{
resolve: `gatsby-transformer-remark`,
options: {
plugins: [
{
resolve: `gatsby-remark-prismjs`,
options: {
languageExtensions: [
{
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36",
"environment": {
"networkUserAgent": "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3694.0 Mobile Safari/537.36 Chrome-Lighthouse",
"hostUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36",
"benchmarkIndex": 1134
},
"lighthouseVersion": "5.0.0",
"fetchTime": "2019-05-22T06:59:47.871Z",
"requestedUrl": "https://www.hajk.ch/de/",
{"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36","environment":{"networkUserAgent":"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3694.0 Mobile Safari/537.36 Chrome-Lighthouse","hostUserAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36","benchmarkIndex":1304},"lighthouseVersion":"4.2.0","fetchTime":"2019-05-22T06:28:36.367Z","requestedUrl":"https://www.hajk.ch/de/","finalUrl":"https://www.hajk.ch/de/","runWarnings":[],"audits":{"is-on-https":{"id":"is-on-https","title":"Uses HTTPS","description":"All sites should be protected with HTTPS, even ones that don't handle sensitive data. HTTPS prevents intruders from tampering with or passively listening in on the communications between your app and your users, and is a prerequisite for HTTP/2 and many new web platform APIs. [Learn more](ht
{"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36","environment":{"networkUserAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36","hostUserAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36","benchmarkIndex":1250},"lighthouseVersion":"4.2.0","fetchTime":"2019-05-22T06:28:03.116Z","requestedUrl":"https://www.hajk.ch/de/","finalUrl":"https://www.hajk.ch/de/","runWarnings":[],"audits":{"is-on-https":{"id":"is-on-https","title":"Uses HTTPS","description":"All sites should be protected with HTTPS, even ones that don't handle sensitive data. HTTPS prevents intruders from tampering with or passively listening in on the communications between your app and your users, and is a prerequisite for HTTP/2 and many new web platform APIs. [Learn more](https://developers.google.com/web/
@mhauri
mhauri / randomProductGenerator.php
Last active August 9, 2018 17:48
Magento: Random Product Generator
<?php
require_once 'app/Mage.php';
$app = Mage::app();
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$default = 100;
$api = new Mage_Catalog_Model_Product_Api();
$attr_api = new Mage_Catalog_Model_Product_Attribute_Set_Api();
$attribute_sets = $attr_api->items();
@mhauri
mhauri / AdminCreateSimpleProductCest.xml
Last active November 18, 2017 14:51
MFTF - AdminCreateSimpleProductCest.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
@mhauri
mhauri / AdminLoginCest.xml
Created November 18, 2017 13:23
MFTM - AdminLoginCest.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
@mhauri
mhauri / rtc_8segment.ino
Created May 17, 2012 17:10
Arduino Real Time clock with 8 Digit Segment-Display
/*
rtc_8segement
Real Time Clock with 8 Digit Segment-Display
Needed Hardware
An Arduino or compatible board like:
http://www.play-zone.ch/de/elektronik-kit-zubehoer/avr-arduino-freeduino/boards-kompatibel/freaduino-v1-2-mit-atmega328-100-arduino-kompatibel.html