Skip to content

Instantly share code, notes, and snippets.

@onlime
onlime / .eslintrc.js
Created August 30, 2021 21:37
Configure ESLint and Prettier for Vue/Nuxt.js project in VS Code
module.exports = {
root: true,
env: {
browser: true,
node: true,
},
parserOptions: {
parser: '@babel/eslint-parser',
requireConfigFile: false,
},
@av01d
av01d / colorValues.js
Last active February 9, 2024 16:01
Javascript: Convert any color (hex, hexa, rgb, rgba, hsl, named) to [r,g,b,a] array
/**
* Convert any color string to an [r,g,b,a] array.
* @author Arjan Haverkamp (arjan-at-avoid-dot-org)
* @param {string} color Any color. F.e.: 'red', '#f0f', '#ff00ff', 'rgb(x,y,x)', 'rgba(r,g,b,a)', 'hsl(180, 50%, 50%)'
* @returns {array} [r,g,b,a] array. Caution: returns [0,0,0,0] for invalid color.
*/
const colorValues = color => {
const div = document.createElement('div');
div.style.backgroundColor = color;
document.body.appendChild(div);
@megahirt
megahirt / Docker with XDebug.md
Last active October 25, 2024 01:12
Debugging PHP with XDebug v3 inside Docker using VSCode

Debugging PHP with XDebug v3 inside Docker using VSCode

Assumptions / Prerequisites

  • XDebug v3+ inside Docker (e.g. php:7.3-apache Docker image)
  • Running Docker v20.10+
  • VSCode with PHP Debug Extension (Felix Becker)
  • Using Docker Compose for orchestration

Objective

@Nielio
Nielio / compose.yml
Last active October 11, 2024 17:44
Gitlab CE with build in Container Registry behind Traefik 2 with Letsencrypt
version: "3.6"
services:
gitlab:
image: gitlab/gitlab-ce
volumes:
- gitlab-data:/var/opt/gitlab
- gitlab-logs:/var/log/gitlab
- gitlab-config:/etc/gitlab
networks:
- traefik-public
@chrisedrego
chrisedrego / vault-mysql-docker-compose.yaml
Created March 12, 2021 09:26
Vault MySQL Docker-compose
version: "3.3"
services:
vault:
image: vault
container_name: vault-dev
ports:
- '8200:8200'
restart: always
volumes:
- ./vault/config:/vault/config
# Source: https://gist.github.com/48f44d3974db698d3127f52b6e7cd0d3
###########################################################
# Automation of Everything #
# How To Combine Argo Events, Workflows, CD, and Rollouts #
# https://youtu.be/XNXJtxkUKeY #
###########################################################
# Requirements:
# - k8s v1.19+ cluster with nginx Ingress
@pitpit
pitpit / README.md
Last active March 21, 2023 11:32
gedmo/doctrine-extensions translatable behavior (or stof/doctrine-extensions-bundle) and alice fixtures

Translated alice fixtures for gedmo translatable entities

Here's a way that doesn't require any additional code to create translated fixtures via alice.

The example works with the single translation table from Gedmo (ext_translations) but I assume it also works in a multi tables model.

My entity:

#src/Entity/Article.php
# Source: https://gist.github.com/a0a7ff04a7e22409cdfd8b466edb4e48
#################################################
# Argo Events #
# Event-Based Dependency Manager for Kubernetes #
# https://youtu.be/sUPkGChvD54 #
#################################################
#########
# Setup #
@wpconsulate
wpconsulate / MySQL_5.7_macOS-Big_Sur.md
Created January 9, 2021 22:01
Install MySql 5.7 on MacOS Big Sur

This is a fork of original gist https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e, with slight changes on pointing to 5.7 version branch, instead of 8 (latest default of MySQL in Hombrew).

Install MySQL 5.7 on macOS

This procedure explains how to install MySQL using Homebrew on macOS (Sierra 10.12 and up)

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.
@Raistlfiren
Raistlfiren / Dockerfile
Last active September 13, 2024 08:29
XDebug 3 and Docker Reference
FROM php:7.4-cli-alpine
# Install xdebug
RUN apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS \
&& pecl install xdebug \
&& docker-php-ext-enable xdebug \
&& apk del .phpize-deps
WORKDIR /var/www/html