Skip to content

Instantly share code, notes, and snippets.

View kastnerp's full-sized avatar
🍋
Focusing

Patrick Kastner kastnerp

🍋
Focusing
View GitHub Profile
@robinknowles
robinknowles / ParaView Run Receipts.md
Created August 4, 2023 14:21
A scriptable method for producing run summary receipts for sharing in Slack/Teams/Whatsapp

Run Receipts in ParaView

Accompanies OnCFD Newsletter #158

Attached is an example ParaView script to create a "run receipt" summary of your results like this 👇

Straight from the command-line & ready to post into Slack/Teams/WhatsApp

@jackellenberger
jackellenberger / migrating_youtube_subscriptions.md
Created June 12, 2022 21:51
Migrating YouTube subscriptions from one account to another

Migrating YouTube subscriptions from one account to another

It's a pain in the butt! there's no google-provided way to do it and the extensions that were written to do it are all terrible or non-functional. Luckily, youtube runs on "computers" and "computers" can be "hackarino'd" with just a bit of encouragement. Prereqs are a) ability to follow instructions b) maybe some familiarity with bash. I'm writing this from my mac, it'll be the sameish on linux and WSL.

This is for non-"brand" accounts, cause i'm not a brand. I'm a small business man, not a small business, man. I'm not a man either but whatever.

1. Download your subscriptions with Takeout

This at least is easy.

  1. open youtube.com > profile icon > your data in youtube, should take you to myaccount.
@SkyyySi
SkyyySi / youtube-vanced-alternatives.md
Last active March 26, 2024 03:03
A list of alternatives after the shutdown of Vanced

NONE OF THESE CLIENTS ARE VERIFIED BY ME FOR SECURITY OR ANYTHING ELSE! USE AT YOUR OWN RISK!

These are the current alternatives (with links when possible):

@1kastner
1kastner / run_python_script_in_conda_env.bat
Last active March 5, 2024 08:27 — forked from maximlt/run_python_script_in_conda_env.bat
Run a Python script in a conda environment from a batch file
@ECHO OFF
SETLOCAL EnableDelayedExpansion
REM Insert your conda env here
SET CONDA_ENV=MY_DESIRED_CONDA_ENV
CALL :activate_conda_env
REM Insert your python script here
@codebykyle
codebykyle / connect.ps1
Last active March 28, 2024 05:10
Windows Terminal Split Pane Powershell Script - v2
using namespace System.Collections.Generic
# Encapsulate an arbitrary command
class PaneCommand {
[string]$Command
PaneCommand() {
$this.Command = "";
}
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
#Import-Module PSColors
#Import-Module posh-git
Import-Module -Name Terminal-Icons
@shanselman
shanselman / ohmyposhv3-v2.json
Last active March 28, 2024 11:48
ohmyposhv3-v2
{
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,
@Sukonnik-Illia
Sukonnik-Illia / my_json_dums.py
Last active August 25, 2023 09:20
Python 3 Json with 2 decimals after comma
# We need to ensure that c encoder will not be launched
@patch('json.encoder.c_make_encoder', None)
def json_dumps_with_two_digit_float(some_object):
# saving original method
of = json.encoder._make_iterencode
def inner(*args, **kwargs):
args = list(args)
# fifth argument is float formater which will we replace
args[4] = lambda o: '{:.2f}'.format(o)
return of(*args, **kwargs)
@jdbcode
jdbcode / get-hex-colors.py
Last active March 1, 2024 13:16
Get a list of n hex colors for a given matplotlib palette
# Source: https://stackoverflow.com/a/33597599/5391200
from pylab import *
cmap = cm.get_cmap('seismic', 5) # matplotlib color palette name, n colors
for i in range(cmap.N):
rgb = cmap(i)[:3] # will return rgba, we take only first 3 so we get rgb
print(matplotlib.colors.rgb2hex(rgb))
cmap = cm.get_cmap('plasma', 101)
@maximlt
maximlt / run_python_script_in_conda_env.bat
Last active February 12, 2024 20:09
Run a Python script in a conda environment from a batch file
@echo OFF
rem How to run a Python script in a given conda environment from a batch file.
rem It doesn't require:
rem - conda to be in the PATH
rem - cmd.exe to be initialized with conda init
rem Define here the path to your conda installation
set CONDAPATH=C:\ProgramData\Miniconda3
rem Define here the name of the environment