Skip to content

Instantly share code, notes, and snippets.

@bfcoder
bfcoder / gist:3fbd5c38e296d1ce259a86770a04f973
Created March 3, 2023 18:12
Docker build imagemagick in ubuntu 22.04 with heic support
FROM public.ecr.aws/docker/library/ubuntu:22.04
RUN sed -i "s|^# deb-src http:\/\/archive.ubuntu.com\/ubuntu\/ jammy universe|deb-src http://archive.ubuntu.com/ubuntu\/ jammy universe|g" /etc/apt/sources.list
RUN sed -i "s|# deb-src http:\/\/archive.ubuntu.com\/ubuntu\/ jammy-updates universe|deb-src http://archive.ubuntu.com/ubuntu\/ jammy-updates universe|g" /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y \
build-essential \
wget \
git \
@clandestine8
clandestine8 / Production.Dockerfile
Last active July 1, 2024 23:03
UNIT3D Dockerfile - WIP
FROM php:8.1-fpm-alpine
# ENV & Build ARGS
ENV LARAVEL_DIR /var/www
ARG BRANCH=master
WORKDIR ${LARAVEL_DIR}
# Install Deps
RUN apk add --no-cache git sed nginx nodejs npm openssh-client libzip-dev libsodium-dev icu-dev mysql-client supervisor freetype-dev libjpeg-turbo-dev libpng-dev
RUN apk add --no-cache $PHPIZE_DEPS
@Stoyvo
Stoyvo / DockerFile
Last active January 3, 2023 09:56
GCP App Engine PHP 8.1 Flexible Environment
FROM php:8.1.1-fpm-alpine
# HEAVILITY INFLUENCED BY https://github.com/TrafeX/docker-php-nginx
# Without TrafeX repository, I'd still be doing this.
LABEL maintainer="Stoyvo"
# No interative terminals
ENV DEBIAN_FRONTEND noninteractive
# Set timezone to UTC. Just easier that way with most cloud services.
@hurricup
hurricup / install_imagemagic_with_heic.sh
Last active September 17, 2025 04:17
How to install ImageMagick 7.1.0-54 with HEIC and WEBP support on Ubuntu 20.04
# inspired by https://gist.github.com/rjnienaber/af47fccb8410926ba7ea35f96c3b87fd
# remove bundled ImageMagick
sudo apt remove imagemagick -y
# install base dependencies
sudo apt-get install -y \
build-essential \
git \
libde265-dev \
@AnandPilania
AnandPilania / Socialite.php
Last active November 18, 2024 23:39
LARAVEL: Social Auth via Socialite with Breeze
<?php
namespace App\Models;
use App\Traits\BelongsToUser;
use Illuminate\Database\Eloquent\Concerns\HasTimestamps;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Socialite extends Model
date.timezone = Asia/Ho_Chi_Minh
max_execution_time = 300
max_input_time = 300
short_open_tag = On
realpath_cache_size = 640k
realpath_cache_ttl = 86400
memory_limit = -1
upload_max_filesize = 16M
post_max_size = 16M
expose_php = Off
@ChrisHardie
ChrisHardie / storycorps-to-rss.php
Created October 14, 2019 16:41
Example PHP script to generate an RSS feed of a StoryCorps Archives interview search result
<?php
$storycorps_archive_html = file_get_contents( 'https://api.storycorps.me/wp-json/interviews?filter[places]=richmond,indiana' );
$storycorps_archive = json_decode( $storycorps_archive_html, true );
$xml = new SimpleXMLElement('<rss/>');
$xml->addAttribute("version", "2.0");
$channel = $xml->addChild("channel");
@Xilonz
Xilonz / bedrock-autoloader.php
Created June 10, 2019 14:24
Bedrock Autoloader compatable with symlinked plugins directory
<?php
/**
* Plugin Name: Bedrock Autoloader
* Plugin URI: https://github.com/roots/bedrock/
* Description: An autoloader that enables standard plugins to be required just like must-use plugins. The autoloaded plugins are included during mu-plugin loading. An asterisk (*) next to the name of the plugin designates the plugins that have been autoloaded.
* Version: 1.0.0
* Author: Roots
* Author URI: https://roots.io/
* License: MIT License
*/
@pmurzakov
pmurzakov / Badoo PHP Russia 2019 talk.md
Last active June 1, 2025 15:22
Badoo PHP performance -- useful links and snippets -- PHP Russia 2019 talk
@tranghaviet
tranghaviet / laravel.conf
Last active October 19, 2021 07:43
Nginx block config for laravel
# Permission for laravel project
# sudo chgrp -R www-data storage bootstrap/cache
# sudo chmod -R ug+rwx storage bootstrap/cache
# OR: sudo chown -R <user>:www-data storage bootstrap/cache
# Allow current user edit file
# sudo usermod -a -G www-data <username>
# sudo chmod 775 -R storage
# After created, enable this configuration