Skip to content

Instantly share code, notes, and snippets.

View iron-viper's full-sized avatar
🏠
Working from home

iron-viper

🏠
Working from home
View GitHub Profile

Installing Laravel in a subfolder

Installing Laravel in a domain subfolder can be useful in certain situations, although it is not officially supported by Laravel creators. In this instruction, I will describe how to configure Laravel 10 in a subfolder and additional tools such as Livewire v3.

Table of Contents

  1. Laravel Basse
  2. Livewire
  3. Filament Panel Builder

Laravel Base

@iron-viper
iron-viper / nginx.conf
Created May 12, 2024 12:29 — forked from un1ko85/nginx.conf
Rewrite URI with nginx and php-fpm. I have faced the problem that REQUEST_URI parameter is not changed on nginx rewrite rule. After some research I have found solution with replacing $request_uri variable.
server {
listen 80;
server_name site.dev;
index index.php;
root /Users/balkon_smoke/Sites/site.dev/web;
error_log /Users/balkon_smoke/Sites/site.dev/logs/error.log;
access_log /Users/balkon_smoke/Sites/site.dev/logs/access.log;
location / {
@iron-viper
iron-viper / SwapOctaneServer.php
Created October 18, 2023 09:57 — forked from pascalbaljet/SwapOctaneServer.php
Blue-green deployment with Laravel Octane
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Console\Concerns\CallsCommands;
use Illuminate\Support\Facades\Http;
use Laravel\Forge\Forge;
use Laravel\Forge\Resources\Daemon;
#!/bin/bash
# Function to convert the version string
convert_version_string() {
local input_string=$1
local version_number="${input_string#*/v}" # Remove everything before '/v'
local version_parts=($(echo "$version_number" | tr '.' ' ')) # Split version string into parts
# Ensure we have at least three parts (major, minor, patch)
while (( ${#version_parts[@]} < 3 ))
@iron-viper
iron-viper / MySql-5.6-installation guide.md
Created June 29, 2021 14:11 — forked from vinodpandey/MySql-5.6-installation guide.md
Install MySQL 5.6.xx on Ubuntu 18.04 & Ubuntu 20.04

MySQL Download URL

https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.46-linux-glibc2.12-x86_64.tar.gz

Open the terminal and follow along:

  • Uninstall any existing version of MySQL
sudo rm /var/lib/mysql/ -R
@iron-viper
iron-viper / Queries.sql
Created April 2, 2019 06:22 — forked from OlegPetrenkoGit/Queries.sql
Sql interview
-- 1. Вывести список сотрудников, получающих заработную плату большую чем у непосредственного руководителя
SELECT *
FROM Employee AS employees, Employee AS chieves
WHERE chieves.id = employees.chief_id AND employees.salary > chieves.salary;
-- 2. Вывести список сотрудников, получающих максимальную заработную плату в своем отделе
SELECT *
FROM Employee AS employees
WHERE employees.salary = (SELECT MAX(salary) FROM Employee AS max WHERE max.department_id = employees.department_id);
<?php
$credentials = "username:password";
// Read the XML to send to the Web Service
$request_file = "./SampleRequest.xml";
$fh = fopen($request_file, 'r');
$xml_data = fread($fh, filesize($request_file));
fclose($fh);
<?php
function quickSort($array)
{
if (count($array) < 2) {
return $array;
}
$pivot = array_shift($array);
@iron-viper
iron-viper / findIdsByParentId.php
Last active October 27, 2016 19:30
Find ids in tree array by parent id includes parent id(recursively)
<?php
/**
* @author iron-viper
*/
$array = [
[
"id" => 1,
"name" => "test-1",
"parent" => 0,
"children" => [
@iron-viper
iron-viper / list.html.twig
Created October 27, 2016 10:34 — forked from tentacode/list.html.twig
Twig recursive macro
{% macro recursiveCategory(category) %}
<li>
<h4><a href="{{ path(category.route, category.routeParams) }}">{{ category }}</a></h4>
{% if category.children|length %}
<ul>
{% for child in category.children %}
{{ _self.recursiveCategory(child) }}
{% endfor %}
</ul>