Skip to content

Instantly share code, notes, and snippets.

View Rud5G's full-sized avatar
🏡
Working remotely

Rudger Rud5G

🏡
Working remotely
View GitHub Profile
@leegilmorecode
leegilmorecode / pipeline-stack.ts
Created March 24, 2023 18:09
Example running Cypress in a CDK Pipelines pipeline
...
// add the feature-dev stage with the relevant environment config to the pipeline
// this is the test stage (beta)
const featureDevStage: PipelineStage = new PipelineStage(
this,
'FeatureDev',
{
...environments.featureDev,
}
export interface EnvironmentConfig {
env: {
account: string;
region: string;
};
stageName: string;
stateful: {
bucketName: string;
};
stateless: {
@Rud5G
Rud5G / IAMCredentials.json
Last active July 24, 2022 19:07 — forked from ServerlessBot/IAMCredentials.json
Minimum credential set for Serverless Framework
{
"Statement": [
{
"Action": [
"apigateway:*",
"cloudformation:CancelUpdateStack",
"cloudformation:ContinueUpdateRollback",
"cloudformation:CreateChangeSet",
"cloudformation:CreateStack",
"cloudformation:CreateUploadBucket",
#!/bin/bash
set -eu
# see: https://gist.github.com/Rud5G/71058242650001f6a5e4eeb4003daaa3
if ! test -f "$(pwd)/bin/magento";
then
echo "Usage $0"
echo ""
@zepgram
zepgram / AbstractPdf.php
Created June 17, 2022 13:43
PDF size reduction for Magento 2
<?php
declare(strict_types=1);
namespace MyNamespace\Sales\Model\Order\Pdf;
use Magento\Sales\Model\Order\Pdf\AbstractPdf as MagentoAbstractPdf;
/**
* Drastically reduce size of PDF by changing fonts
@Rud5G
Rud5G / .env
Last active June 13, 2022 08:44
Common collection (bash)
PROFILE=sandbox
@peterjaap
peterjaap / identify.php
Last active September 6, 2023 08:12
Identify used Magento 2 frontend extensions in a Luma install
<?php
// Run with the URL pointing to a require-config.js as the first argument;
// php identify.php http://magento2demo.firebearstudio.com/pub/static/frontend/Magento/luma/en_US/requirejs-config.js
$content = file_get_contents($argv[1]);
preg_match_all(
'/(?P<quote>\'|")(?P<extension>[[:alnum:]]+_[[:alnum:]]+)\/js\/.+?(?P=quote)/m',
$content,
$matches
#!/bin/bash
#
# findleak
##########################################################################
# Script that displays an overview of the virtual memory growth per process
# for the last 14 days. Per process you can find the PID and process name,
# how many days the process has lived (max. 14 days), the total growth of
# the memory consumption during that number of days, and the growth for
# each day (in MiB).
# Processes that were only present for 1 day and processes that did not
@max10rogerio
max10rogerio / slugify.ts
Last active April 26, 2024 14:00
Typescript slug function
// MIT License
// Copyright (c) 2023 Max Rogério
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions: