Skip to content

Instantly share code, notes, and snippets.

View lcloss's full-sized avatar
🦊
Keep learning

Luciano Closs lcloss

🦊
Keep learning
View GitHub Profile
@lcloss
lcloss / server1.ps1
Created January 17, 2024 09:01
Alternative to launch PHP / Laravel webserver locally
param (
[int]$port = 8055
)
# Start the PHP built-in server on the specified port
# php -S "localhost:$port" -t public/
php artisan serve --host=localhost --port=${port}
@lcloss
lcloss / server.ps1
Created December 21, 2023 14:04
Start PHP server locally
# Start a PHP server
# Usage: server.ps1 [port]
# Example: server.ps1 8000
$port = 8000
if ($args.Length -gt 0) {
$port = $args[0]
}
$cmd = "php -S localhost:$port"
@lcloss
lcloss / elementor_sound_control.js
Created December 8, 2023 14:04
Elementor toggle sound button
<script>
document.addEventListener('DOMContentLoaded', function() {
var toggleSoundButtonMuted = document.querySelector('.e-fas-volume-mute');
var toggleSoundButtonSound = document.querySelector('.e-fas-volume-up');
toggleSoundButtonSound.style.display = "none";
var iconWrapper = toggleSoundButtonMuted.closest('.elementor-icon');
var secondIconWrapper = toggleSoundButtonSound.closest('.elementor-icon');
secondIconWrapper.removeChild(toggleSoundButtonSound);
var heroBackgroundVideo = document.querySelector('.herosection video');
@lcloss
lcloss / OrgPhotos.ps1
Created July 20, 2023 08:35
Windows Shell script to organize photos in subfolders
#
# Description: Organize photos by date taken
#
# Example:
#
# From path where photos are, type:
#
# OrgPhotos
#
# > It will create subfolders grouped by Year and then by date, moving all
@lcloss
lcloss / compressing.ps1
Last active July 20, 2023 08:36
Compressing and Extracting folders
#
# Uses 7Z to compress all $targetPath's subfolders.
#
# Example:
# root
# - HTML
# - Folder1
# - Folder2
# - Folder3
#
@lcloss
lcloss / .bashrc
Last active June 27, 2020 15:53
Bash
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@lcloss
lcloss / install-composer.sh
Created May 12, 2020 16:35
Install Composer on Linux, Ubuntu, etc.
#!/bin/bash
# Install Composer on Centos, Ubuntu, Debian
# Inspired by: https://gist.github.com/virbo/c3169ed490564f36f0c239d6fd16f749
user_allow="root"
if [ "$(whoami)" != $user_allow ]; then
echo "==================================================================="
echo " Falha na instalação. O composer deve ser instalado com o user: "$user_allow" ="
echo "==================================================================="
@lcloss
lcloss / FindFileOrFolder.ps1
Created August 29, 2019 23:25
Search for a file or folder with PowerShell
Write-Output "Finding $($args[0])..."
Get-ChildItem –Path C:\ -Include $args[0] -Recurse -ErrorAction SilentlyContinue
@lcloss
lcloss / ListEmptyFolders.vbs
Created March 16, 2019 23:08
CScript: List Empty Folders recursivelly
Option Explicit
Dim objFSO
Set objFSO=CreateObject("Scripting.FileSystemObject")
If (WScript.Arguments.Count <> 2) Then
WScript.Echo("Usage: cscript ListEmptyFolders.vbs {path} {list file}")
' If at least 1 argument is passed, list them
If (WScript.Arguments.Count > 0) Then
@lcloss
lcloss / BackupFolders.vbs
Created March 16, 2019 23:07
CScript: Backup one folder to another (the first is the master)
Option Explicit
If (WScript.Arguments.Count <> 2) Then
WScript.Echo("Usage: cscript BackupFolders.vbs {source} {dest}")
' If at least 1 argument is passed, list them
If (WScript.Arguments.Count > 0) Then
Dim strArg
Dim i