Skip to content

Instantly share code, notes, and snippets.

View andrewmy's full-sized avatar

Andrew andrewmy

View GitHub Profile
@PiRXlv
PiRXlv / eParaksts liberator.user.js
Created June 6, 2023 14:12
Tampermonkey script to liberate eParaksts password field
// ==UserScript==
// @name eParaksts liberator
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Remove stupid fieldChanged script which doesn't allow pasting password
// @author PiRXlv
// @match https://eidas.eparaksts.lv/trustedx-authserver/eparaksts-idp/signatureConsent.xhtml*
// @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
// @grant none
// ==/UserScript==
@ciaranmcnulty
ciaranmcnulty / notes.md
Last active March 25, 2024 06:36
Notes on using Docker on ARM Macs (November 2021)

Docker for Mac

On M1 machines, Docker for Mac is running a lightweight linux ARM VM, then running containers within that, so containers are essentially running natively. Don't be fooled by the fact the UI or binary CLI tools (e.g. docker) might require Rosetta.

Within that VM is an emulation layer called QEmu. This can be used by docker to run Intel containers. This does not use Rosetta at all, and has a roughly 5-6X performance penalty. (If you just upgraded your CPU this may result in a similar performance to your old machine!)

Pulling and running with Docker

Many images in public registries are multi-architecture. For instance at the time of writing on Docker Hub the php:8.0-cli image has the following digests:

@2color
2color / test.yaml
Last active April 10, 2024 18:57
How to run integration tests with PostgreSQL and Prisma on GitHub Actions
# .github/workflows/test.yaml
name: test
on: push
jobs:
test:
runs-on: ubuntu-latest
# Service containers to run with `container-job`
services:
# Label used to access the service container
postgres:
@Pierstoval
Pierstoval / Makefile
Last active March 2, 2021 14:38
"Check requirements" command for your Makefile
# Use it like this:
#
# $ printf $(_TITLE) "Something in green" "The message"
#
# This will output something like this:
#
# [Something in green] The message
#
# (of course, with proper colors)
_TITLE := "\033[32m[%s]\033[0m %s\n" # Green text
@romaricdrigon
romaricdrigon / docker-compose.override.yaml
Created August 27, 2020 14:36
Using Mutagen Compose
version: '3.7'
volumes:
appdata: ~
code: ~
services:
php:
volumes:
- code:/var/www/html
<?php
declare(strict_types=1);
namespace Infrastructure\Messaging;
use Doctrine\Persistence\ManagerRegistry;
use Psr\Log\LoggerInterface;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Middleware\MiddlewareInterface;
@kunicmarko20
kunicmarko20 / Login.php
Last active March 25, 2024 10:56
Symfony OAuth with Leage OAuth2 library
<?php
declare(strict_types=1);
namespace App;
use Symfony\Component\HttpFoundation\Response;
use Twig\Environment;
use League\OAuth2\Client\Provider\Google as GoogleProvider;
@kunicmarko20
kunicmarko20 / gcs
Last active August 25, 2021 10:01
Select branch to checkout from a list of recent ones.
#!/bin/bash
select branch in $(git branch --sort=-committerdate | head -n6 | grep -v "*")
do
git checkout $branch
exit
done
<?php
declare(strict_types=1);
namespace Tests;
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase as BaseWebTestCase;
use Symfony\Component\BrowserKit\Cookie;
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
@tarlepp
tarlepp / Dockerfile_dev
Last active March 23, 2019 09:06
docker-compose setup for Symfony application with MySQL, PHP-FPM and Nginx + extra docker-sync for osx users - for Windows users there isn't real solution yet...
FROM php:7.2.13-fpm
RUN apt-get update \
&& apt-get install -y \
zlib1g-dev libxml2-dev \
nano vim git unzip jq \
&& rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install -j$(nproc) \
bcmath \