Skip to content

Instantly share code, notes, and snippets.

View evopix's full-sized avatar

Brandon Summers evopix

View GitHub Profile
@Nemo64
Nemo64 / doctrine_live_tempaltes.xml
Created March 29, 2021 11:42
Live templates for common doctrine fields
<template name="bool:default" value="/**&#10; * @var bool&#10; * @ORM\Column(type=&quot;boolean&quot;, options={&quot;default&quot;: $default$})&#10; */&#10;private bool $$$name$ = $default$;&#10;&#10;$END$&#10;&#10;public function is$method$(): bool&#10;{&#10; return $this-&gt;$name$;&#10;}&#10;&#10;public function set$method$(bool $$$name$): void&#10;{&#10; $this-&gt;$name$ = $$$name$;&#10;}" description="boolean column" toReformat="false" toShortenFQNames="true">
<variable name="name" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="default" expression="enum(&quot;false&quot;, &quot;true&quot;)" defaultValue="" alwaysStopAt="true" />
<variable name="method" expression="capitalize(name)" defaultValue="" alwaysStopAt="false" />
<context>
<option name="PHP Class Member" value="true" />
</context>
</template>
<template name="bool:nullable" value="/**&#10; * @var bool|null&#10; * @ORM\Column(type=&quot;boolean&quot;, nullable=true)&#10; */&#10;private ?bool $$$name$ = nul
@lucjross
lucjross / .tf
Last active May 20, 2020 02:54
ALB Listener Rule, weighted Target Groups
resource "aws_alb_listener_rule" "http_80" {
count = local.lb ? 1 : 0
listener_arn = data.aws_alb_listener.http_80.arn
action {
type = "forward"
target_group_arn = aws_alb_target_group.http_80[0].arn
}
condition {
host_header {
values = [local.host_name]
@IanColdwater
IanColdwater / twittermute.txt
Last active July 2, 2024 02:25
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@jamiegs
jamiegs / adaptive-ecs-scaling.md
Last active November 5, 2019 00:17
Description of ECS scaling solution developed for Hudl.

Adaptive Container Scaling

Problems with AWS's recommended scaling method

  • Based on a fixed percentage of memory and CPU reservation.
  • Scaling on both cpu and memory metrics can cause the metrics to fight with each other where it'll scale out then back in and repeat.
  • If you're scaling threshold is at 80% memory, current reservation utilization is at 79% and you deploy a container that requires 25% memory, It will fail to launch.
  • ASGs are not container aware.

Solution

@dayne
dayne / 0-WSL-SSH-README.md
Last active June 30, 2024 05:22
WLS-Helpers

Install linux subsystem Ubuntu 18.04

See Microsoft's WSL install guide for windows 10 for details.

Work-in-progress - command line only install:

  • Open Powershell as Administrator and run:
    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
  • Open Windows App Store
    • Search for "Ubuntu" and install Ubuntu 18.04

(work in progress - command line install steps):

@eugenestarchenko
eugenestarchenko / README.md
Created May 21, 2018 13:19
Simple ECS service deploy script

Deploy updates to aws ecs services based on github commits. Posts deploy notifications to slack.

Assumptions:

  • Task definitions map 1:1 with services, and they have the same name.
  • Code is stored on github
  • You want to deploy the latest commit in a branch
  • Docker images are tagged with commit SHA
  • Docker images are stored on AWS ECR
@andyrbell
andyrbell / scanner.sh
Last active July 9, 2024 16:43
Make a pdf look scanned using ImageMagick
# use ImageMagick convert
# the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf
convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf
// services.yml
catalog.kernel.request_event_listener:
class: App\CoreBundle\EventListener\KernelBootDatabaseSwitchListener
arguments: [@request, @doctrine.dbal.default_connection, @logger]
scope: request
tags:
- { name: kernel.event_listener, event: kernel.request, method: onKernelRequest }
// KernelContextListener
/**
@Xymanek
Xymanek / DataConnectionWrapper.php
Created August 23, 2017 08:17
Symfony multi-tenant database
<?php
namespace AppBundle\Doctrine;
use AppBundle\Entity\Organisation;
use Doctrine\DBAL\Connection;
use Acme\Common\DatabaseNameResolver;
class DataConnectionWrapper extends Connection
{
/**