The following snippets can be used to build a cross platform script to manage a local Anaconda environment by anyone.
conda create -y -p ./.env python=3.9 && conda activate ./.env
conda deactivate
#!/usr/bin/python3 | |
import os, sys, requests, re, html | |
banner = ''' | |
#================================================== | |
# A script to process youtube playlist takeout | |
#================================================== | |
''' | |
print(banner) |
#SingleInstance force | |
; Hotkey: Alt + S | |
!s:: | |
; Check if window active window exists | |
WinGetTitle, t, a | |
if(t = "Program Manager" or t = "") { | |
MsgBox ,, No window selected!, Please select a window.`n(Alt + Tab) | |
return |
function pollNESController() { | |
const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads : []); | |
const controllerInput = { | |
isPresent: false, | |
dpad: '', | |
select: 0, | |
start: 0, | |
a: 0, | |
b: 0 | |
}; |
# Based on https://www.tensorflow.org/datasets/keras_example | |
# Requires numpy, pygame, tensorflow and tensorflow-datasets | |
NUMBER_OF_EPOCHS = 8 | |
import numpy as np | |
import pygame | |
pygame.init() | |
pygame.display.set_caption('MNIST digits') |
#!/usr/bin/env python3 | |
import os, re, random, copy, sys, atexit | |
clear = lambda: os.system('cls' if os.name == 'nt' else 'clear') | |
def print_header(): | |
print(' _____ _ _____ _____ ') | |
print(' |_ _(_)_|_ _|_ _ _|_ _|__ ___ ') | |
print(' | | | / _|| |/ _` / _|| |/ _ \/ -_)') |
#!/usr/bin/env python3 | |
import os, re, random | |
clear = lambda: os.system('cls' if os.name == 'nt' else 'clear') | |
def print_header(): | |
print(' _____ _ _____ _____ ') | |
print(' |_ _(_)_|_ _|_ _ _|_ _|__ ___ ') | |
print(' | | | / _|| |/ _` / _|| |/ _ \/ -_)') |
// ==UserScript== | |
// @name 2xYT | |
// @version 0.1 | |
// @description Automatically sets the playback speed to 2x on YouTube.com | |
// @match *://www.youtube.com/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; |
import socket | |
import argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument('-m', '--mode', choices=['sender', 'receiver'], required=True) | |
arguments = parser.parse_args() | |
is_sender = arguments.mode == 'sender' | |
receiver_port = 1234 | |
receive_size = 1024 |
import cv2 | |
cap = cv2.VideoCapture(0) | |
tracker = cv2.TrackerMOSSE_create() | |
roi = None | |
while True: | |
_, frame = cap.read() |