Skip to content

Instantly share code, notes, and snippets.

@marcelgsantos
marcelgsantos / palestra-commits-incriveis.md
Last active November 24, 2024 19:12
Referências da palestra 'Criando Commits Incríveis com Git' apresentada no PHPeste Recife 2024
@robiot
robiot / ometv.js
Last active June 28, 2025 03:50
OME.TV Camera Switcher that works with ex. OBS Virtual Camera
// 1. Open inspector with CTRL+SHIFT+I
// 2. Select the console tab in the top
// 3. Paste the script
// 4. Press enter
// 5. Hover over your own video, and there should be a video switcher that looks horrible but works.
const localVideo = document.getElementById("local-video");
if (localVideo) {
// Create a dropdown element for the camera switcher
@dublado
dublado / images-names.md
Created November 21, 2022 12:33
docker image names Alpine, Slim, Stretch, Buster, Jessie, Bullseye qual a diferença ?

Alpine, Slim, Stretch, Buster, Jessie, Bullseye qual a diferença ?

stretch/buster/jessie são releases do debian

Bullseye e Bookworm são versões de desenvolvimento, não estáveis

-slim são versões com o mínimo possivel para rodar o que é proposto no Dockerfile

-alpine são versões baseadas no sistema operacional Alpine (se for utilizar algumas compilações que dependem de glibc talvez queira olhar o musl nesse ambiente, pois é a biblioteca usada

@guibranco
guibranco / Dockerfile
Last active July 9, 2025 16:11
Docker file for PHP 5.6 with Apache, MySQL extension, GD2 and Apache mod_rewrite enabled
FROM php:5.6-apache
RUN sed -i -e 's/deb.debian.org/archive.debian.org/g' \
-e 's|security.debian.org|archive.debian.org/|g' \
-e '/stretch-updates/d' /etc/apt/sources.list
RUN apt-get update
RUN apt-get install --yes --force-yes cron g++ gettext libicu-dev openssl libc-client-dev libkrb5-dev libxml2-dev libfreetype6-dev libgd-dev libmcrypt-dev bzip2 libbz2-dev libtidy-dev libcurl4-openssl-dev libz-dev libmemcached-dev libxslt-dev
RUN a2enmod rewrite
@mooror
mooror / snippet.php
Last active July 30, 2024 13:20
PHP Code Snippet - Add hours and minutes to date time string and convert it to timestamp
<?php
///////////////////////////////////
// //
// Using DateTime Object (OOP) //
// //
///////////////////////////////////
// The original date time string
// NOTE: This is currently using the current date and time
@cecilemuller
cecilemuller / 2019-https-localhost.md
Last active July 30, 2025 02:06
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@hoandang
hoandang / php-docker-ext
Created May 20, 2017 01:12
Complete list of php docker ext
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN docker-php-ext-install mcrypt
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
@pdaw
pdaw / managing_supervisor.sh
Last active March 2, 2025 20:11
Supervisor running in systemd (it's manually configured because usage of virtualenv, not distribution package)
# activating supervisor service
systemctl enable supervisor.service
# checking if service is active
systemctl is-active supervisor.service
# checking service status
systemctl status supervisor.service
# managing service
@nonbeing
nonbeing / git-deployment.md
Last active June 26, 2025 13:40 — forked from noelboss/git-deployment.md
Simple deployment using git's post-receive hook

Also see: https://gist.github.com/lemiorhan/8912188

Simple automated deployment using git hooks

Here are the simple steps needed to push your local git repository directly to a remote (e.g. prod) server over ssh. This is based on Digital Ocean's Tutorial.

Overview

You are developing in a working-directory on your local machine, let's say on the master branch. Usually people push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use GitHub's webhooks to send a POST request to a webserver to take appropriate actions such as cloning/checking out a branch on the remote (prod) server.

@morvanabonin
morvanabonin / comandos-docker
Last active June 12, 2025 20:41
Comandos do Docker
Segue a lista de comandos docker e sua utilidade:
docker attach – Acessar dentro do container e trabalhar a partir dele.
docker build – A partir de instruções de um arquivo Dockerfile eu possa criar uma imagem.
docker commit – Cria uma imagem a partir de um container.
docker cp – Copia arquivos ou diretórios do container para o host.
docker create – Cria um novo container.
docker diff – Exibe as alterações feitas no filesystem do container.
docker events – Exibe os eventos do container em tempo real.
docker exec – Executa uma instrução dentro do container que está rodando sem precisar atachar nele.