Skip to content

Instantly share code, notes, and snippets.

@mkelley33
Created February 25, 2024 21:53
Show Gist options
  • Select an option

  • Save mkelley33/eb1549dddb65672a0724c2a91bd873fc to your computer and use it in GitHub Desktop.

Select an option

Save mkelley33/eb1549dddb65672a0724c2a91bd873fc to your computer and use it in GitHub Desktop.
zsh script to replace all spaces and special characters in a file name for all files in the directory with dashes and make all letters lowercase removing the last dash in the file name
#!/bin/zsh
# Iterate over files in the directory
for filename in *; do
# Check if the filename is a regular file
if [[ -f "$filename" ]]; then
# Extract filename and extension
base_filename=$(basename "$filename")
extension="${base_filename##*.}"
base_filename="${base_filename%.*}"
# Replace spaces and special characters with dashes, and convert to lowercase
new_base_filename=$(echo "$base_filename" | tr -s '[:space:]' '-' | tr -s '[:punct:]' '-' | tr '[:upper:]' '[:lower:]')
# Remove trailing dashes
new_base_filename=${new_base_filename%-}
# Combine new filename with extension
new_filename="${new_base_filename}.${extension}"
# Rename the file
mv "$filename" "$(dirname "$filename")/$new_filename"
echo "File '$filename' renamed to '$new_filename'"
fi
done
@umutali3472-byte
Copy link
Copy Markdown

from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.floatlayout import FloatLayout
from kivy.core.window import Window
from kivy.utils import get_color_from_hex
from kivy.clock import Clock

class HackSakaApp(App):
def build(self):
Window.clearcolor = get_color_from_hex('#FF0000')
self.sayac = 10
self.layout = FloatLayout()

    self.mesaj = Label(
        text="!!! SISTEM CÖKTÜ !!!\n\nuzayliegemen verileri siliniyor...\n\nCIHAZ IMHASINA SON:",
        font_size='22sp',
        halign='center',
        pos_hint={'center_x': 0.5, 'center_y': 0.6},
        color=(1, 1, 1, 1)
    )
    
    self.zaman_label = Label(
        text=str(self.sayac),
        font_size='80sp',
        bold=True,
        pos_hint={'center_x': 0.5, 'center_y': 0.3},
        color=(1, 1, 0, 1)
    )
    
    self.layout.add_widget(self.mesaj)
    self.layout.add_widget(self.zaman_label)
    Clock.schedule_interval(self.guncelle, 1)
    return self.layout

def guncelle(self, dt):
    if self.sayac > 0:
        self.sayac -= 1
        self.zaman_label.text = str(self.sayac)
    else:
        self.zaman_label.text = "ELVEDA!"
        self.mesaj.text = "SISTEM TAMAMEN SILINDI.\n\nUmut Yazılım Sundu..."
        return False # Sayacı durdurur

if name == 'main':
HackSakaApp().run()

@umutali3472-byte
Copy link
Copy Markdown

Icardi_Ozel_Hediye.py

@umutali3472-byte
Copy link
Copy Markdown

Icardi Animasyon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment