This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Add checks for essential modules | |
local ok_lspconfig, lspconfig = pcall(require, "lspconfig") | |
if not ok_lspconfig then | |
vim.notify("Error: `lspconfig` module not found. QML LSP setup aborted.", vim.log.levels.ERROR) | |
return {} | |
end | |
local configs = require("lspconfig.configs") | |
local util = require("lspconfig.util") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
def read_map_from_file(file_path): | |
"""Reads the map from a file and returns a list of strings representing the map.""" | |
with open(file_path, "r") as file: | |
# Skip the first line (the number of lines) | |
map_data = file.readlines()[1:] | |
# Strip any trailing newline characters |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env dash | |
unused_packages_file="$HOME/gecici/unused_packages.txt" | |
echo "do you want a clean $unused_packages_file file ? y/N" | |
read -r clean_file | |
if [ "$clean_file" = "y" ]; then | |
echo "" >"$unused_packages_file" # clean up | |
fi | |
echo "deleting" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import requests | |
from bs4 import BeautifulSoup | |
from urllib.parse import urljoin, urlparse | |
from concurrent import futures as cfutures | |
def download_file(url, base_folder): | |
try: | |
response = requests.get(url) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
// Check if there is an audio or video element on the page | |
const mediaElements = document.querySelectorAll('audio, video'); | |
if (mediaElements.length === 0) { | |
console.log('No media elements found on this page.'); | |
return; | |
} | |
// Create an AudioContext | |
const audioContext = new (window.AudioContext || window.webkitAudioContext)(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def float_to_binary_32(f): | |
""" | |
Converts a 32-bit floating-point number to its binary representation. | |
Args: | |
f (float): The floating-point number to encode. | |
Returns: | |
str: The binary representation of the floating-point number. | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import random | |
import shutil | |
import ctypes | |
def main(wallpapers_path: str, cur_wall_path: str): | |
random_selected_image = wallpapers_path + str( | |
random.choice(os.listdir(wallpapers_path)) | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this is a powershell script to uset it download as raw and execute with pwsh (powershell) | |
# i found from internet | |
# - link https://superuser.com/a/1209478 | |
# not tested in win11 but i think it will work fine | |
# ---- | |
$signature = @" | |
[DllImport("user32.dll")] | |
public static extern bool SystemParametersInfo(int uAction, int uParam, ref |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python3 | |
from cryptography.fernet import Fernet | |
import os | |
def generate_key(): | |
# Generating a random 16-byte key (Base64-encoded) | |
return Fernet.generate_key() | |
def load_key(key_file_path): | |
if os.path.exists(key_file_path): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from glob import glob | |
import os | |
from pathlib import Path | |
from pprint import pprint | |
import re | |
class Counter : | |
def __init__(self,name, start=0): | |
self.name = name | |
self.num = start |
NewerOlder