Skip to content

Instantly share code, notes, and snippets.

View mmackh's full-sized avatar

Maximilian Mackh mmackh

View GitHub Profile
@mmackh
mmackh / delegate.m
Last active October 29, 2019 14:39
Catalyst - NSToolbar Search
static NSString * toolbarIdentifierSearch = @"Search";
@interface IPDFToolbarItem : NSToolbarItem
@property (atomic,readwrite) id view;
@property CGSize minSize;
@property CGSize maxSize;
@end
@mmackh
mmackh / IPDFContextMenu.h
Last active May 31, 2020 23:55
NSMenu in Catalyst
//
// IPDFContextMenu.h
// InstaPDF
//
// Created by Maximilian Mackh on 02/02/15.
// Copyright (c) 2015 mackh ag. All rights reserved.
//
#import <Foundation/Foundation.h>
  1. Created an iFrame on the product page with the content 'Loading...' to adjust the styling to fit the page
  2. Added iFrame to top of product page on Mobile, adjusted properties to collapsed & hidden on page load
  3. Added custom JS code that will check if: Mobile, Product Page URL contains appropriate model substring.
import wixWindow from 'wix-window';
import wixLocation from 'wix-location';

$w.onReady(function () {
@mmackh
mmackh / woocommerce_extension.php
Last active July 8, 2021 08:51
Role Based Pricing - Manual Order
function woocommerce_ajax_add_order_item_meta( $item_id, $raw_item, $order ) {
$product = $raw_item->get_product();
$rolePrices = $product->get_meta('_role_based_price' );
if (!$rolePrices) return;
$userRole = array_shift($order->get_user()->roles);
if (!isset($rolePrices[$userRole])) return;
$grossPrice = $product->get_price_including_tax();
$netPrice = $product->get_price_excluding_tax();
@mmackh
mmackh / PasteboardHelper.h
Last active April 4, 2022 07:58
PasteboardHelper - Load .eml files from Mail.app (macOS)
//
// PasteboardHelper.h
// Spaceboard
//
// Created by mmackh on 28.03.22.
//
#import <Foundation/Foundation.h>
@class PasteboardHelperPromiseResolveRequest;
import BaseComponents
class LayoutViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
view.addSplitView { splitView in
splitView.addSplitView(configurationHandler: { splitView in
splitView.direction = .horizontal