Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@97997
97997 / randomGame.py
Created April 16, 2023 20:26
Given a list of games with their launch URL command asks the user if it wants to play a random game
#Example of list.txt file
'''
Deathsmiles@@steam://rungameid/314180
Mushihimesama@@steam://rungameid/377860
Playnite Game@@playnite://playnite/start/6108f780-32bf-46c8-8db5-7aa626cfbfdf
'''
import webbrowser
import random
while True:
@97997
97997 / randomMusicAlbum.py
Created April 11, 2023 10:30
This script will open a random folder within a list of folders and will load said folder into the music player
# This script will open a random folder within a list of folders and will load said folder into the music player
# You need to set up the variables "music_player_executable" and "music_folders"
import os
import random
import subprocess
def open_random_folder(folder_path):
# Get a list of all the folders in the given path
@97997
97997 / batchmp4tomp3v0.py
Created July 17, 2022 15:00
#script takes working directory mp4 files (and others) (only tested with mp4) and uses ffmpeg to convert to variable bitrate mp3 files
#script takes working directory mp4 files (and others) (only tested with mp4) and uses ffmpeg to convert to variable bitrate mp3 files
workingDirectory = 'C:\\directory_with_the_mp4_files\\'
files = []
import os
for individualFile in os.listdir(workingDirectory):
totalpath = workingDirectory + individualFile
if individualFile.endswith(('.mp4', '.wmv', '.avi', '.mkv')):
files.append(totalpath)
for item in files:
os.system("ffmpeg -i \"" + item + "\" -q:a 0 -map a \"" + item.rsplit('.', 1)[0] + '\".mp3')
@97997
97997 / main.py
Created October 31, 2021 13:00
uptime and ip monitoring
from os import system, name
from time import sleep
from requests import get
from tkinter import messagebox
# TODO Guardar variable a un archivo, checar el archivo frecuentemente, si se detecta un cambio de ip, enviar email
def render():
# ctypes required for using GetTickCount64()
import ctypes
#Makes a trim of video using fmmpeg
import os
import tkinter as tk
from tkinter import filedialog
def filePick():
root = tk.Tk()
root.withdraw()
@97997
97997 / main.js
Created January 4, 2021 23:29
872688659\js\main.js
var symbolSize = 20;
var streams = [];
function setup() {
createCanvas(
window.innerWidth,
window.innerHeight
);
background(0);
var x = 0;
import random
from copy import deepcopy
lines = []
f = open("opciones.txt")
for line in f.readlines():
lines.append(line.strip())
def generate(lines):
static_lines = deepcopy(lines)
@97997
97997 / gist:3a0aa4296dda070b6cdb1805d0acae59
Last active December 26, 2020 23:19
fill disk with random music
import folderooptest
import random
import shutil
import os
targetFolder = r"J:\BlackBerry\music" + "\\"
fill_until_there_are_x_free_megas = 100
music_collection_folder = r"G:\Albums"
path_to_check = r"J:\BlackBerry\music"
@97997
97997 / FolderInterface
Last active December 17, 2020 09:55
FolderInterface.py
# Public class members #
# __init__ constructor: can take one optional argument which is the full path of the desired folder
# if no argument is given class will promt user to select a folder
# files -> tuple: tuple of basename files in folder
# folders -> tuple: tuple of foldernames in folder
# path -> string: string of the selected directory
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
* {
box-sizing: border-box;
}
/* Create two equal columns that floats next to each other */