Skip to content

Instantly share code, notes, and snippets.

View Edwardtonnn's full-sized avatar
🎯
Focusing

Edward Edwardtonnn

🎯
Focusing
  • Los Angeles Web Club
  • South Gate, CA
View GitHub Profile
@Edwardtonnn
Edwardtonnn / index.php
Created November 10, 2023 16:50
Blog Link Cards with Image
<div class="flexy flexy-pad equal-height is-multiline pv100">
<div class="flexy-item is-4 is-6-widescreen animate fadeIn no-delay">
<a class="card no-pad" href="/">
<img lazy-src="/assets/img/blog/gum-line-cavities.jpg" alt="<?php AltTag() ?>">
<div class="card-content">
<h2 class="title-sm uppercase mb65 animate fadeIn no-delay">Replace</h2>
<p class="animate fadeIn white small-subhead no-delay">Replace</p>
<p class="animate fadeIn no-delay">Replace</p>
<span class="button animate fadeIn no-delay mb50">Read More</span>
@Edwardtonnn
Edwardtonnn / index.js
Created August 17, 2023 16:56
Update logo color on scroll. Changes logo from white to black on scroll
const logo = document.querySelector('.navbar__logo');
const menuButton = document.querySelector('.menu-button');
let isScrolled = false;
let isMenuOpen = false;
function updateLogo() {
if (isMenuOpen || isScrolled) {
logo.src = '/assets/img/logo.svg';
} else {
logo.src = '/assets/img/logo-white.svg';
@Edwardtonnn
Edwardtonnn / index.html
Last active July 28, 2023 21:39
use of picsum
<img src="https://picsum.photos/seed/fun/2000/1000?grayscale" alt="Image 1">
<img src="https://picsum.photos/seed/art/2000/1000" alt="Image 2">
<!-- https://picsum.photos/ -->
@Edwardtonnn
Edwardtonnn / index.php
Created July 28, 2023 21:22
Default title and description section
<?php include $_SERVER['DOCUMENT_ROOT'] . "/assets/inc/variables.php" ?>
<?php
$seotitle = "REPLACE in $city $state | $sitename";
$seodesc = "$sitename offers premier $profession services in $city, $state. Call $phone today to schedule your REPLACE appointment today.";
$section = "procedure";
?>
@Edwardtonnn
Edwardtonnn / rename.py
Created July 16, 2023 23:17
Renames jpg or png files to sequence 01.jpg and output jpg
import os
def rename_files(extension):
files = [f for f in os.listdir() if f.endswith(extension)]
for i, file in enumerate(sorted(files), start=1):
os.rename(file, f"{str(i).zfill(2)}{extension}")
if __name__ == "__main__":
rename_files(".jpg")
rename_files(".png")
@Edwardtonnn
Edwardtonnn / rename.py
Created July 13, 2023 21:01
Rename Png images to sequence
import os
def rename_images():
image_files = [f for f in os.listdir() if f.endswith('.png')]
image_files.sort()
for i, filename in enumerate(image_files):
new_filename = '{:02d}.png'.format(i + 1)
os.rename(filename, new_filename)
print('Renamed {} to {}'.format(filename, new_filename))
@Edwardtonnn
Edwardtonnn / Rename.py
Created July 13, 2023 17:54
Python to rename files
import os
folder_path = os.getcwd()
for filename in os.listdir(folder_path):
if filename.endswith(".png.jpg"):
new_filename = filename.replace(".png", "")
os.rename(os.path.join(folder_path, filename), os.path.join(folder_path, new_filename))
print("Renamed '{}' to '{}'".format(filename, new_filename))
@Edwardtonnn
Edwardtonnn / index.html
Last active January 29, 2024 16:37
Card with Image no padding
<div class="flexy flexy-pad equal-height is-multiline pv100">
<div class="flexy-item is-4 is-6-widescreen animate fadeIn">
<a class="card no-pad" href="/">
<img lazy-src="/assets/img/blog" alt="">
<div class="card-content">
<h2 class="title-sm uppercase mb65 animate fadeIn"></h2>
<p class="animate fadeIn small-subhead"></p>
<p class="animate fadeIn"></p>
<span class="button animate fadeIn mb50">Read More</span>
</div>
@Edwardtonnn
Edwardtonnn / swiper.php
Created June 28, 2023 18:07
Swiper.js functionality
<?php include $_SERVER['DOCUMENT_ROOT'] . "/assets/inc/variables.php" ?>
<?php
include $_SERVER['DOCUMENT_ROOT'] . $galleryRoot . "index.php";
if (isset($_GET["gp"]) && $_GET["gp"]) {
$patient = $_GET["gp"];
}
@Edwardtonnn
Edwardtonnn / rename_folders.ps1
Created May 31, 2023 21:17
Bulk folder increment
cd 'C:\path\to\your\directory'
Get-ChildItem -Directory | Sort-Object Name -Descending | ForEach-Object {
$newName = "{0:D2}" -f ([int]$_.Name + 1)
Rename-Item -Path $_.FullName -NewName $newName
}