Skip to content

Instantly share code, notes, and snippets.

View Rud5G's full-sized avatar
🏡
Working remotely

Rudger Rud5G

🏡
Working remotely
View GitHub Profile
diff --git a/Mail/Message.php b/Mail/Message.php
index 1f423e801087..0e4d79aac933 100644
--- a/Mail/Message.php
+++ b/Mail/Message.php
@@ -171,7 +171,6 @@ private function createMimeFromString($body, $messageType)
$part = new Part($body);
$part->setCharset($this->zendMessage->getEncoding());
$part->setEncoding(Mime::ENCODING_QUOTEDPRINTABLE);
- $part->setDisposition(Mime::DISPOSITION_INLINE);
$part->setType($messageType);
@marcguyer
marcguyer / AbstractFunctionalTest.php
Last active February 9, 2020 10:56
Functional test abstract using phpunit, Expressive, Doctrine ORM, OAuth2, PSR7, PSR15
<?php
declare(strict_types=1);
namespace FunctionalTest;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Tools\SchemaTool;
use PHPUnit\Framework\TestCase;
use Psr\Container\ContainerInterface;
@versedi
versedi / webpack.config.js
Last active May 15, 2024 14:09
Webpack Encore + Sass + MiniCSSExtractPlugin + PurgeCSS + OptimizeCss + Babel + Typescript
/* eslint-disable no-useless-escape */
const Encore = require('@symfony/webpack-encore');
const TerserPlugin = require('terser-webpack-plugin');
const CircularDependencyPlugin = require('circular-dependency-plugin');
const HtmlCriticalWebpackPlugin = require('html-critical-webpack-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const PurgeCssPlugin = require('purgecss-webpack-plugin');
const WebpackBar = require('webpackbar');
const path = require('path');
@jimwhimpey
jimwhimpey / service-worker.js
Last active November 10, 2022 22:26
An example of our cachable asset manifest that gets inlined into the top of our service worker file during by the build
self.__serviceWorkerManifest= [
// This is the HTML file that we initial load, we normalize
// any Slack client URL to request this same file
{
url: "/boot/client.html",
hash: "52de82b6a380a284b31a6e7be0999050"
// Of course our JS and CSS assets are cached
}, {
url: "https://a.slack-edge.com/bv1-6-9b2646d/client-lazy-components.2ce886f.cache-gantry-1565714987.min.js",
hash: "2ce886f1b462f7437012"
@mnapoli
mnapoli / README.md
Created July 17, 2019 11:28
SAM templates vs Serverless templates

SAM template for a Bref HTTP application:

AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31

Resources:
    MyFunction:
        Type: AWS::Serverless::Function
        Properties:
@sshymko
sshymko / install_mysql_client.sh
Last active March 14, 2024 20:10
Install MySQL 5.7 client on Amazon Linux 2
#!/bin/sh
sudo yum install -y https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
sudo yum install -y mysql-community-client
import axios from 'axios'
let myData = [{id: 0}, {id: 1}, {id: 2}, {id: 3}]
async function fetchData(dataSet) {
for(entry of dataSet) {
const result = await axios.get(`https://ironhack-pokeapi.herokuapp.com/pokemon/${entry.id}`)
const newData = result.data
updateData(newData)
@ServerlessBot
ServerlessBot / IAMCredentials.json
Last active December 20, 2023 16:50
Minimum credential set for Serverless Framework
{
"Statement": [
{
"Action": [
"apigateway:*",
"cloudformation:CancelUpdateStack",
"cloudformation:ContinueUpdateRollback",
"cloudformation:CreateChangeSet",
"cloudformation:CreateStack",
"cloudformation:CreateUploadBucket",
@santiagoprieto
santiagoprieto / aws-ami-codedeploy-agent.md
Last active April 11, 2023 19:57
AWS: How to remove baked in CodeDeploy Agent from AMI and set as User Data

AWS How to:

Remove baked in CodeDeploy Agent from AMI and set as User Data

It is a best practice to not have the CodeDeploy Agent baked into the AMI because AWS will update to new versions quite often. Once they deprecate a version, the AMI will stop being able to deploy new instances, therefore breaking the whole pipeline.

Instead, AWS recommends this CodeDeploy Agent install to be set as User Data within the EC2 Launch Configuration. Because we use CodePipline, CodeDeploy, Auto Scaling Groups, and Load Balancers, we need to change many interlaced pieces.

Instructions:

#!/bin/sh
set -e
# because 409 is not a transient error, the curl param --retry wont effect it.
MAX_RETRIES=5
SLEEP_SECONDS=6
RETRY_ON_HTTPCODE=409
TEMPFILE=/tmp/executecurl-temp.$$