Skip to content

Instantly share code, notes, and snippets.

View shiftenterdev's full-sized avatar
👨‍💻
Working from home

Iftakharul Alam shiftenterdev

👨‍💻
Working from home
View GitHub Profile
@shiftenterdev
shiftenterdev / clock.html
Created July 5, 2023 11:12
Analog javaScript clock
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>NStime</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
html {
background: #fff;
text-align: center;
@shiftenterdev
shiftenterdev / docker-compose.yml
Created May 5, 2023 17:27
Shopware Dockware Docker Compose
version: '3'
services:
shopware:
container_name: shopware
image: dockware/dev:latest
ports:
- "22:22" # ssh
- "443:443"
- "80:80" # apache2

Add composer v2 support to older Magento2 versions

Magento 2.4.2 ships with composer v2 support out of the box but as far as I can see the only thing that needs to happen is to use some more modern versions of certain composer plugins which are used by certain dependencies of Magento.

This means we should be able to add composer v2 support to older Magento2 versions as well if we get a bit creative.

See below for diffs of the composer.json files you can apply to your projects, be sure to keep a mental note of these things, they will need to maintained by yourself in case newer versions of these modules are released. And if one day you update to Magento 2.4.2 or higher, you can remove these changes again.

⚠️ Disclaimer: use these tricks at your own risk!

@shiftenterdev
shiftenterdev / playground.php
Created September 26, 2020 18:51
Magento Play ground
<?php
/**
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @author Iftakharul Alam Bappa <info@shiftenter.dev> 
*/
require __DIR__ . '/app/bootstrap.php';
class Playground extends \Magento\Framework\App\Http implements \Magento\Framework\AppInterface
{
public function launch()
@shiftenterdev
shiftenterdev / custom_form.xml
Created August 20, 2020 09:41
Magento 2 admin ui-component dependable select field
<!-- vendor/module/view/adminhtml/ui_component/custom_form.xml -->
<field name="customer_id" formElement="select" sortOrder="8">
<argument name="data" xsi:type="array">
<item name="options" xsi:type="object">
Strativ\CustomerConnector\Ui\Component\Listing\Column\Customer\Options
</item>
<item name="config" xsi:type="array">
<item name="source" xsi:type="string">true</item>
<item name="label" xsi:type="string" translate="true">Customer Email</item>
** Admin Ui component
@shiftenterdev
shiftenterdev / example.php
Created February 20, 2020 05:01 — forked from dunglas/example.php
A minimalist GraphQL client for PHP
<?php
$query = <<<'GRAPHQL'
query GetUser($user: String!) {
user (login: $user) {
name
email
repositoriesContributedTo {
totalCount
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
#tags{
float:left;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
$('.number').on('keyup blur',function(){
var regx = /^[0-9]+$/i;
var input = $(this).val();
if(!regx.test(input)){
$('.number').val(input.replace(/[a-zA-Z]/g, ''));
}
});