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
# Got this from https://linuxhint.com/crop_videos_linux/ | |
ffmpeg -i in.mp4 -filter:v "crop=out_w:out_h:x:y" out.mp4 | |
# Where: | |
# “in.mp4” refers to the input file to be converted | |
# “out.mp4” is the name of the output file to be saved after conversion | |
# out_w is the width of your desired output rectangle to which the original video’s width will be reduced | |
# out_h is the height of your output rectangle to which the original video’s height will be reduced | |
# x and y are the position coordinates for the top left corner of your desired output rectangle |
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 numpy as np | |
q_word_idx = [1,2,4,7,6,2] | |
a_idx = [1,1,5,6,4,2] | |
q_word_idx = np.array(q_word_idx) | |
a_idx = np.array(a_idx) | |
q_vector_size = 8 | |
a_vector_size = 8 |
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
# ensure you have activated the environment | |
python -m ipykernel install --user --name my_env --display-name "Python (my_env)" | |
# this will create a Jupyter kernel called my_env that will use the python binary and the packages from the current project |
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
// Code for a bouncing ball animation in p5 Js | |
function setup() { | |
createCanvas(400, 400); | |
// frameRate(12) | |
} | |
u = 0 | |
x = 200 | |
y = 100 | |
y_top = 100 | |
last_ch = 60 |
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
for /f "tokens=1 delims=." %a in ('dir /B *.webm') do ffmpeg -i "%a.webm" -c:v copy -crf 0 "%a.mp4" | |
# here "ffmpeg -i "%a.webm" -c:v copy -crf 0 "%a.mp4" is the command to repeat |
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
Thanks to u/IAmBeardPerson on https://www.reddit.com/r/Notion/comments/elh20k/videos_on_html_export_not_properly_exported_fix/ | |
<script> | |
var videos = document.getElementsByClassName("source"); | |
for (var i = 0; i < videos.length; i++) { | |
var source = videos[i].getElementsByTagName("a"); | |
if (source[0].href.includes("youtube")) { | |
var videoObject = document.createElement('iframe'); | |
videoObject.src = source[0].href.replace("watch?v=", "embed/"); | |
videos[i].style.padding = "0"; |
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 json | |
import subprocess | |
import pendulum # pip install pendulum | |
# Note: This is a hacky, quick solution prototyped in less than an hour, the ideal solution would involve using boto3 and other best practices auth | |
# ensure that your AWS CLI is configured and has the keys and default region set up. This script works in the default region | |
instance_cmd = """ | |
aws ec2 describe-instances \ |
OlderNewer