This is a collection of notes on Python, including useful links, useful snippets, Python implementations of algorithms, and notes on built-in and third-party modules.
TODO: migrate existing Python-related Gists into subsections of this Gist
<?php | |
namespace App\Console\Commands\Maintenance; | |
use Illuminate\Console\Command; | |
use Symfony\Component\Process\Process; | |
class MigrateDatabaseServers extends Command | |
{ | |
/** |
#!/bin/bash | |
# This script takes a video file as input and converts it into an HLS (HTTP Live Streaming) playlist with multiple resolutions and bitrates. It also generates a thumbnail image from the video. | |
# Check if an input filename is provided | |
if [ -z "$1" ]; then | |
echo "Usage: $0 input_filename (without extension) [-t]" | |
exit 1 | |
fi |
# A basic script for uninstalling app packages in Windows 10/11, including those pre-installed with Windows | |
# | |
# Note: If you get an error about the script not being allowed to run, the below command will change the execution polciy temporarily for one session only: | |
# Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process | |
# | |
# To execute the script, open a Powershell window to the directory with the script and run the following command using your scripts file name (and don't forget the .\ ) | |
# .\WhateverScriptName.ps1 | |
# ------------------------------------------------------------------------------------------- | |
# Script by ThioJoe - https://github.com/ThioJoe | |
# Source: https://gist.github.com/vfarcic/8301efb15748af1da3e376b7132e519e | |
################################################################### | |
# Should We Run Databases In Kubernetes? CloudNativePG PostgreSQL # | |
# https://youtu.be/Ny9RxM6H6Hg # | |
################################################################### | |
# Additional Info: | |
# - CloudNativePG: https://cloudnative-pg.io | |
# - EDB: https://enterprisedb.com |
/** Basic implementation of NIP 01 filters in typescript. */ | |
interface Event { | |
id : string | |
kind : number | |
created_at : number | |
pubkey : string | |
subject ?: string | |
content : string | |
sig : string |
This is a collection of notes on Python, including useful links, useful snippets, Python implementations of algorithms, and notes on built-in and third-party modules.
TODO: migrate existing Python-related Gists into subsections of this Gist
from fastapi import FastAPI, UploadFile, File, BackgroundTasks | |
from fastapi.responses import JSONResponse | |
from os import getcwd | |
from PIL import Image | |
app = FastAPI() | |
PATH_FILES = getcwd() + "/" | |
import { Component, defineAsyncComponent, defineComponent, h } from 'vue' | |
export function hydrateNever(componentOrFactory: Component): Component { | |
return makeHydrationBlocker(componentOrFactory, { | |
beforeCreate() { | |
this.never = true | |
}, | |
}) | |
} |
default: | |
image: node:15 | |
run-tests: | |
script: | |
- npm install @useoptic/cli # or add as a development dependency in your package manager | |
- npx api run run-diff-tests --exit-on-diff | |
only: | |
- merge_requests |