Skip to content

Instantly share code, notes, and snippets.

View cezarpopa's full-sized avatar
:shipit:
A bit of this and a bit of that.

Cezar Popa cezarpopa

:shipit:
A bit of this and a bit of that.
View GitHub Profile
@mrmartineau
mrmartineau / stimulus.md
Last active May 12, 2024 04:35
Stimulus cheatsheet
@giansalex
giansalex / docker-php-ext-install.md
Last active June 18, 2024 08:44
docker-php-ext-install Reference
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ 
@chronon
chronon / ext.txt
Created February 18, 2017 15:38
List of docker-php-ext-install extension names
Possible values for ext-name:
bcmath
bz2
calendar
ctype
curl
dba
dom
enchant

Debian 10 "Buster" install on Asus ROG GL552VW

Jan 04, 2019 Updating the document for the new debian version

Installation

Download the netinst image for amb64, and copy it to a sdcard/usbstick/etc... Atention Figure out which device (sdX) is your removable media, otherwise you might delete your entire system!

@elenakondrateva
elenakondrateva / Tinyint.php
Last active June 28, 2023 00:21
Custom Doctrine DBAL type 'tinyint' for Symfony
<?php
namespace AppBundle\Doctrine\DBAL\Types;
use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Platforms\AbstractPlatform;
class Tinyint extends Type
{
const TINYINT = 'tinyint';
@basepack
basepack / gist:09fdbdd569020e2a0ff1
Last active November 6, 2018 14:13
WooCommerce : add custom fields to product variations v2.0
<?php
//Display Fields
add_action( 'woocommerce_product_after_variable_attributes', 'variable_fields', 10, 3 );
//JS to add fields for new variations
add_action( 'woocommerce_product_after_variable_attributes_js', 'variable_fields_js' );
//Save variation fields
add_action( 'woocommerce_save_product_variation', 'save_variable_fields', 10, 1 );
/**
<?php
/**
* Limit plugin installations to a single authorized account.
*
* @param array $caps Meta capabailities.
* @param string $cap Primitive capability.
* @param int $user_id User ID.
* @param array $args Arguments.
* @return array Filtered meta capabilities.
*/
@RadGH
RadGH / woocommerce-custom-cart-item-data.php
Last active April 27, 2024 17:25
Get and set custom cart item/product information prior to WooCommerce checkout, and carry those valus over to Order Item Metadata.
<?php
// UPDATE: Stefan from Stack Overflow has explained a better way to handle cart item data.
// See http://stackoverflow.com/a/32327810/470480
// ----------------------
/*
Instructions:
@niksumeiko
niksumeiko / gslint.conf
Created April 7, 2014 10:53
Sample Closure Linter configuration file used within WebStorm IDE
--strict
--jsdoc
--summary
--beep
--check_html
--nomultiprocess
--debug_indentation
--time
@mikejolley
mikejolley / gist:8965846
Created February 12, 2014 22:29
WooCommerce 2.1 - Hiding product dimensions from the product page
// Add to your theme functions.php file
add_filter( 'wc_product_enable_dimensions_display', '__return_false' );