Skip to content

Instantly share code, notes, and snippets.

View manobi's full-sized avatar

Gabriel de Oliveira Barbosa manobi

View GitHub Profile
@yvoronoy
yvoronoy / Magento2-rest-curl-examples
Created May 11, 2017 16:13
Magento2 API Examples
#!/bin/bash
# CREATE CATEGORY REST API
TOKEN=
BASE_URL=$1
echo $BASE_URL
TOKEN=$(curl -X POST "${BASE_URL}index.php/rest/V1/integration/admin/token" \
-H "Content-Type:application/json" \
#!/bin/bash
regions=(local ca-central-1 eu-central-1 ap-southeast-1 ap-northeast-1 us-east-1)
image_name_base="cache-bench"
image_sizes_in_mb=(64 512 1024)
dockerfile="Dockerfile.sample"
log_file=docker-bench.log
@elenakondrateva
elenakondrateva / package.json
Last active August 6, 2019 20:00
Magento 2 Post CSS Autoprefixer
{
"name": "Project",
"author": "Vendor",
"description": "Node modules dependencies for local development",
"version": "2.0.0",
"license": "(OSL-3.0 OR AFL-3.0)",
"repository": {
"type": "git",
"url": "https://github.com/magento/magento2.git"
},
@JesterXL
JesterXL / promiseall.js
Last active October 31, 2022 16:02
Example of using Array Destructuring for Promise.all.
Promise.all([
someThingThatReturnsAPromise(),
otherThingThatReturnsAPromise(),
lastThingThatReturnsAPromise()
])
.then( results =>
{
// this...
const [first, second, third] = results;
// ... instead of
@ahmetb
ahmetb / gcrgc.sh
Last active March 10, 2025 21:51
Script to clean up Google Container Registry images pushed before a particular date
#!/bin/bash
# Copyright © 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@praveenpuglia
praveenpuglia / shadow-dom.md
Last active May 3, 2025 10:03
Everything you need to know about Shadow DOM

I am moving this gist to a github repo so more people can contribute to it. Also, it makes it easier for me to version control.

Please go to - https://github.com/praveenpuglia/shadow-dom-in-depth for latest version of this document. Also, if you find the document useful, please shower your love, go ⭐️ it. :)

Shadow DOM

Heads Up! It's all about the V1 Spec.

In a nutshell, Shadow DOM enables local scoping for HTML & CSS.

@jwilson8767
jwilson8767 / es6-element-ready.js
Last active February 24, 2025 08:50
Wait for an element to exist. ES6, Promise, MutationObserver
// MIT Licensed
// Author: jwilson8767
/**
* Waits for an element satisfying selector to exist, then resolves promise with the element.
* Useful for resolving race conditions.
*
* @param selector
* @returns {Promise}
*/
<?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;
@troyharvey
troyharvey / deployment.yml
Last active April 20, 2025 15:39
Using Kubernetes envFrom for environment variables
# Use envFrom to load Secrets and ConfigMaps into environment variables
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: mans-not-hot
labels:
app: mans-not-hot
spec:
replicas: 1