Skip to content

Instantly share code, notes, and snippets.

View joaolisboa's full-sized avatar

João Lisboa joaolisboa

View GitHub Profile
@mayoff
mayoff / EqualIconWidthDomain.swift
Created August 12, 2021 04:39
Complete code for https://stackoverflow.com/a/68751668/77567 (EqualIconWidthDomain for SwiftUI Label views)
import SwiftUI
fileprivate struct IconWidthKey: PreferenceKey {
static var defaultValue: CGFloat? { nil }
static func reduce(value: inout CGFloat?, nextValue: () -> CGFloat?) {
switch (value, nextValue()) {
case (nil, let next): value = next
case (_, nil): break
case (.some(let current), .some(let next)): value = max(current, next)
@gpressutto5
gpressutto5 / LocalValetDriver.php
Created September 1, 2017 21:16
Magento 2 Local Driver for Laravel Valet
<?php
class LocalValetDriver extends LaravelValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
@ticean
ticean / Category.sql
Created December 10, 2010 04:45
A series of queries for selecting Magento entity EAV attributes, and their values. Lots of union here...
SET @entityid = '3';
SELECT ea.attribute_id, ea.attribute_code, eav.value AS 'value', 'varchar' AS 'type'
FROM catalog_category_entity e
JOIN catalog_category_entity_varchar eav
ON e.entity_id = eav.entity_id
JOIN eav_attribute ea
ON eav.attribute_id = ea.attribute_id
WHERE e.entity_id = @entityid
UNION