Skip to content

Instantly share code, notes, and snippets.

View alies-dev's full-sized avatar
🎯
Focusing

Alies Lapatsin alies-dev

🎯
Focusing
View GitHub Profile
@alies-dev
alies-dev / instructions.md
Last active July 5, 2024 09:07
Laravel GitHub workflows (starting pack)

Context

These assets created for the First hour of a new Laravel project article.

Instructions

Add these files to the .github/workflows directory of your project, commit and push them.

main.yml example uses PostgreSQL DB as an exammple. You can read more about other services:

@alies-dev
alies-dev / lob.php
Created April 7, 2023 11:29
Lob example
<?php
/** @var \OpenAPI\Client\Configuration $config */
/** @var string $from_lob_address_id */
/** @var string $front */
/** @var string $back */
$editableAddress = new AddressEditable([
'address_line1' => 'al. Jana Pawła II 21/37',
'address_city' => 'Warszawa',
# A basic deptrac config for Laravel application to isolate HTTP context from the rest of the app
# see https://qossmic.github.io/deptrac/
# see https://alies.dev/articles/
deptrac:
paths:
- ./app
layers:
- name: Model
@alies-dev
alies-dev / build-nginx.sh
Created March 13, 2021 13:01 — forked from Yinchie/build-nginx.sh
Compiling NGiNX with OpenSSL TLS1.3, Brotli, more_headers, NAXSI - Ubuntu 20.04.1 x64
#!/usr/bin/env bash
# Run as root or with sudo
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root or with sudo."
exit 1
fi
# Make script exit if a simple command fails and
# Make script print commands being executed
set -e -x
@alies-dev
alies-dev / readme.md
Last active March 11, 2019 07:59
Examples of real-life Laravel applications (OSS)
@alies-dev
alies-dev / gtmetrics-comparison-snippet.js
Last active June 10, 2022 18:24
GTMetrics comparison snippet
function returnRefinedURL(url) {
return url.replace(new RegExp("=\\w+"),"").replace("?&","?").replace("&&","&");
}
testsAndRequests = [];
document.querySelector('.report-waterfall').contentWindow.document.querySelectorAll('.vsc-initialized table .netTable').forEach((table, index) => {
table.querySelectorAll('.netFullHrefLabel.netHrefLabel.netLabel ').forEach((row, rowIndex) => {
if (rowIndex === 0) { testsAndRequests.push([]); }
testsAndRequests[index].push(row.textContent);
/**
* @module modules/courseAdInjector
* @description Inject advertisement block to the document using specified rules
* @example courseAdInjector.addCourseAd('.js-courseAd-area');
*/
define(['jquery', 'modules/countdown'], ($, Countdown) => {
/**
* @returns {Object}
* @private
*/