Skip to content

Instantly share code, notes, and snippets.

View charliepage88's full-sized avatar

Charlie Page charliepage88

View GitHub Profile
import path from 'path'
import vue from '@vitejs/plugin-vue'
import icons from 'vite-plugin-svg-icons'
import inspect from 'vite-plugin-inspect'
import tailwindcss from 'tailwindcss'
import autoprefixer from 'autoprefixer'
import createDebugger from 'debug'
import { defineConfig } from 'laravel-vite'
export default defineConfig()
@CodebyOmar
CodebyOmar / icon-with-badge-tailwind.html
Last active July 10, 2023 06:53
Place a badge that show notification numbers or number of items in a cart at top right of an icon with tailwindcss
<button class="py-4 px-1 relative border-2 border-transparent text-gray-800 rounded-full hover:text-gray-400 focus:outline-none focus:text-gray-500 transition duration-150 ease-in-out" aria-label="Cart">
<svg class="h-6 w-6" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" stroke="currentColor">
<path d="M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0z"></path>
</svg>
<span class="absolute inset-0 object-right-top -mr-6">
<div class="inline-flex items-center px-1.5 py-0.5 border-2 border-white rounded-full text-xs font-semibold leading-4 bg-red-500 text-white">
6
</div>
</span>
</button>
@charliepage88
charliepage88 / laravel_permissions.sh
Last active January 18, 2020 22:56
Simple shell script to setup unix permissions for Laravel
#!/usr/bin/env bash
cd /var/www/projects/projectname
sudo find storage/ -type f -exec chmod 664 {} \;
sudo find storage/ -type d -exec chmod 775 {} \;
sudo find bootstrap/cache/ -type f -exec chmod 664 {} \;
sudo find bootstrap/cache/ -type d -exec chmod 775 {} \;
sudo chown -R www-data:dev storage
@ivan
ivan / grab-anchor-episode.sh
Last active May 16, 2024 22:16
Download a podcast episode from anchor.fm
#!/usr/bin/env bash
# Download a podcast episode from anchor.fm
#
# Usage:
# grab-anchor-episode "https://anchor.fm/emerge/episodes/Robert-MacNaughton---Learnings-from-the-Life-and-Death-of-the-Integral-Center-e31val" # (m4a example)
# grab-anchor-episode "https://anchor.fm/free-chapel/episodes/Are-You-Still-In-Love-With-Praise--Pastor-Jentezen-Franklin-e19u4i8" # (mp3 example)
#
# anchor.fm serves a list of m4a or mp3 files that need to be concatenated with ffmpeg.
#
@Spittal
Spittal / docker-compose.override.yaml
Created September 15, 2018 02:44
Docker Compose override from Springboard VR
version: '3'
services:
fpm:
volumes:
- ./:/var/www
environment:
- OPCACHE_ENABLED=0
worker:
volumes:
@Spittal
Spittal / docker-compose.yaml
Created September 15, 2018 02:43
Docker compose file from SBVR
version: '3'
services:
fpm:
image: sbvr/laravel-fpm:2.1.2
volumes:
- app:/var/www
networks:
- appnet
worker:
@crabmusket
crabmusket / MJML.php
Last active April 12, 2024 11:39
MJML emails in Laravel
<?php
namespace App\Mail;
use Symfony\Component\Process\Process;
use Symfony\Component\Process\Exception\ProcessFailedException;
use Symfony\Component\Process\Exception\RuntimeException;
use Illuminate\Contracts\View\Factory as ViewFactory;
use Illuminate\Support\HtmlString;
@slenky
slenky / 01_createfiles.config
Created March 28, 2018 10:21
AWS Elastic Beanstalk -- Let's Encrypt for load-balanced environments
files:
"/home/ec2-user/set_env.sh":
mode: "000755"
owner: root
group: root
content: |
instance_id=$(curl -s http://169.254.169.254/latest/meta-data/instance-id)
region=$(curl -s http://169.254.169.254/latest/dynamic/instance-identity/document | grep region | awk -F\" '{print $4}')
ebenvname=$(aws --output text ec2 describe-tags --region $region --filters "Name=resource-id,Values=${instance_id}" "Name=key,Values=elasticbeanstalk:environment-name" | awk '{print $5}')
@kyleferguson
kyleferguson / Dockerfile
Last active December 19, 2023 06:10
Example Laravel deployment for Kubernetes
FROM php:7.1-apache
ADD . /var/www
ADD ./site.conf /etc/apache2/sites-enabled/000-default.conf
RUN apt-get update && apt-get install -y libmcrypt-dev mysql-client && \
docker-php-ext-install mcrypt pdo_mysql opcache && \
pecl install redis-3.1.2 && docker-php-ext-enable redis && \
a2enmod rewrite
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active September 7, 2024 14:29
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files: