Skip to content

Instantly share code, notes, and snippets.

View dsbilling's full-sized avatar
🤓

Daniel S. Billing dsbilling

🤓
View GitHub Profile
@dsbilling
dsbilling / rename.py
Created December 15, 2021 14:09
Rename files in current directory and sub-directories
import os
def process_directory(root):
for root, dirs, files in os.walk(root):
for name in files:
if name.endswith(".new"):
print("Renamed -> ", name)
os.rename(os.path.join(root, name), os.path.join(root, name.replace(".new", "")))
process_directory(os.path.dirname(os.path.realpath(__file__)))
@dsbilling
dsbilling / livewire-tailwind.blade.php
Last active May 22, 2022 12:04
Laravel Pagination: Dark/Light Tailwind
<div>
@if ($paginator->hasPages())
@php(isset($this->numberOfPaginatorsRendered[$paginator->getPageName()]) ? $this->numberOfPaginatorsRendered[$paginator->getPageName()]++ : $this->numberOfPaginatorsRendered[$paginator->getPageName()] = 1)
<nav role="navigation" aria-label="Pagination Navigation" class="flex items-center justify-between">
<div class="flex justify-between flex-1 sm:hidden">
<span>
@if ($paginator->onFirstPage())
<span class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-500 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-700 cursor-none leading-5 rounded-md">
{!! __('pagination.previous') !!}
@dsbilling
dsbilling / reset-proxmox-cluster.sh
Last active January 12, 2024 00:40
A simple script to reset the Proxmox Cluster.
#/bin/bash -xe
systemctl stop corosync.service
systemctl stop pve-cluster.service
systemctl stop corosync
systemctl stop pve-cluster
pmxcfs -l
rm /etc/pve/corosync.conf
rm /etc/corosync/*
rm /var/lib/corosync/*