Skip to content

Instantly share code, notes, and snippets.

View ramaID's full-sized avatar
🏠
Working from home

Qisthi Ramadhani ramaID

🏠
Working from home
View GitHub Profile
@shinsenter
shinsenter / Reduce docker image size.md
Last active March 14, 2024 02:22
Make your Docker images smaller by reducing the number of layers
@shinsenter
shinsenter / Experimental Docker structure.md
Last active November 5, 2023 14:25
Docker structure for deploying to multiple environments

Beginning

There are many approaches to implementing a reuse of a common preset for Docker services for multiple environments, such as production and local environments.

This makes it possible to ensure the highest consistency for different environments with the same code-base. Implementing reuse of docker compose options also makes it easier to manage them.

I found on github a project called serversideup/spin. They took an approach using a feature called Docker overrides, to change some properties of common services for different environments.

After reading through their documentation, I realized that there are a few real-life cases where this project can not implement (or is difficult to archive).

@SumitBando
SumitBando / AlpineToSvelte.md
Last active February 28, 2024 11:45
Tried to use a web page template in a SvelteKit project, unexpectedly found some Alpine.js embedded. Here was the translation.
Original AlpineJS Svelte Translation Explanation
<?php
/**
* In your Livewire model for the list of items
*/
class ItemList extends Component
{
// rest of component
@tanthammar
tanthammar / HasLinks.php
Last active July 5, 2022 18:22
No more controllers! Only Laravel LiveWire routes and a handy Eloquent Model trait.
@arthursalvtr
arthursalvtr / add-custom-mail-driver-to-laravel.md
Last active April 5, 2024 17:43
Add Custom Mail Driver to Laravel

How to add custom Mail Driver to Laravel

Tested on Laravel 5.8

Within the source code of laravel 5.8 at this time of writing, we have this following

<?php

namespace Illuminate\Support;
@milo
milo / php-oci8-debian.md
Last active April 5, 2024 03:22
PHP Oracle OCI8 extension on Linux Debian

Oracle Instant Client libraries installation

Download Oracle Instant Client libraries (URL may change, already happened few times). Be sure you download correct (x64 or x32) architecture. And correct version.

Last time I used Client 21.5.0.0.0 with Oracle 12c and PHP 8.1 and 8.3.

Before that Instant Client 21.3.0.0.0 with Oracle 12c and compiled with PHP 8.0, 7.4 and 7.3 fine.

Before that Instant Client 10.1.0.5.0 with Oracle 10g, 11g and 12c and PHP 5.6, 7.1, 7.2, 7.3 and 7.4.

Never hit any problem with such setups but my queries are quite simple. One should be fine with the newest version. It should be backward compatible (fingers crossed).

@w33zy
w33zy / jpg-png-optimize.md
Created January 4, 2018 20:39 — forked from VirtuBox/jpg-png-optimize.md
Optimize your jpg & png images with jpegoptim and optipng on linux

JPG and PNG image bulk optimization

Install jpegoptim and optipng

apt update && apt install jpegoptim optipng -y

JPG optimization

cd /path/to/your/image/folder
@luceos
luceos / post-checkout
Last active April 27, 2023 17:19 — forked from mariusGundersen/post-checkout
runs composer install after doing a git pull
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` or `git checkout` if a specified file was changed
# Run `chmod +x post-checkout` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id HEAD@{1} HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && echo " * changes detected in $1" && echo " * running $2" && eval "$2"