Skip to content

Instantly share code, notes, and snippets.

View MTheProgrammer's full-sized avatar

Matt Chad MTheProgrammer

View GitHub Profile
@llbbl
llbbl / awesome-php.md
Last active October 1, 2025 22:04 — forked from ziadoz/awesome-php.md
Awesome PHP Libraries and Resources

Awesome PHP

A list of amazingly awesome PHP libraries, resources and shiny things.

Categories

  • Composer
  • Composer Related
  • Frameworks
  • Micro Frameworks
@afternoon
afternoon / rename_js_files.sh
Created February 15, 2014 18:04
Rename .js files to .ts
find app/src -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \;
@magnetikonline
magnetikonline / README.md
Last active August 27, 2025 06:08
Setting Nginx FastCGI response buffer sizes.
@cupracer
cupracer / varnishlog-examples.sh
Last active September 13, 2024 15:57
varnishlog examples (version 4.x)
# filter by request host header
varnishlog -q 'ReqHeader ~ "Host: example.com"'
# filter by request url
varnishlog -q 'ReqURL ~ "^/some/path/"'
# filter by client ip (behind reverse proxy)
varnishlog -q 'ReqHeader ~ "X-Real-IP: .*123.123.123.123"'
# filter by request host header and show request url and referrer header
@mAlishera
mAlishera / ecto_migration.exs
Created January 23, 2017 22:15
Composite primary key in Ecto
defmodule Messaging.Repo.Migrations.CreateGroupChatVersions do
use Ecto.Migration
def change do
create table(:group_chat_versions, primary_key: false) do
add :group_chat_id, :uuid, primary_key: true
add :version, :integer, primary_key: true
timestamps
end
@dianabotean
dianabotean / env.php
Created February 11, 2021 17:38
move open source queues to rabbit
[
(...)
'queue' => [
'amqp' => [
'host' => '<rabbitmq_host>',
'port' => '<rabbitmq_port>',
'user' => '<rabbitmq_user>',
'password' => '<rabbitmq_pass>',
'virtualhost' => '/',
'ssl' => false
@moroz
moroz / application.ex
Created April 3, 2021 05:30
Automatically migrate Ecto database in release
defmodule MyApp.Application do
# See https://hexdocs.pm/elixir/Application.html
# for more information on OTP Applications
@moduledoc false
use Application
@migrator if Mix.env() in [:prod, :staging], do: [MyApp.Migrator], else: []
def start(_type, _args) do
children =
@rishitells
rishitells / Jest_GitLab_CI.md
Last active October 8, 2025 15:13
Setting up Jest tests and coverage in GitLab CI

Configuring Jest Tests in GitLab CI

1. Add GitLab CI configuration file in the root

In the root of your project, add .gitlab-ci.yml with the configuration below.

image: node:latest

stages:
@JeroenBoersma
JeroenBoersma / NGINX - Magento 2 Static files optimization.md
Last active July 2, 2025 22:04
NGINX - Magento 2 Static files optimization

Introduction

Because Varnish doesn't support SSL, most people choose a setup where Nginx SSL will forward all traffic to Varnish and Varnish will forward will forward the traffic it cannot handle back to nginx. Or worse, bind Varnish on port 80 and direct all traffic into Varnish. This will already degrade performance, because Varnish will purge more because static files are also taking up room in the cache.

Default configuration

Next up, the Nginx configuration of Magento will handle static files.

Generate PHP8.1 data model class with constructor promoted properties named ${DTO_NAME} with fields extracted from this array keys:
[
"externalid" => $quoteItem->getItemId(),
"name" => $quoteItem->getName(),
"price" => $this->coreHelper->priceToCents($quoteItem->getPrice()),
"quantity" => $quoteItem->getQty(),
"sku" => $quoteItem->getSku(),
"description" => $quoteItem->getDescription(),
"imageUrl" => $imageUrl,
"productUrl" => $product->getProductUrl()