Handy Python Code Snippets
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
<?php | |
/* | |
This program is free software; you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation; either version 2 of the License, or | |
(at your option) any later version. | |
This program is distributed in the hope that it will be useful, | |
but WITHOUT ANY WARRANTY; without even the implied warranty of | |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
Having descriptive and an organized media file structure is crucial for delivering a video project within a timely manner. Having recently watched this wedding video edit by Scott Mckenna on YouTube, I noticed how he organized his footage by keywords in Final Cut Pro - and I like it a lot.
I've adopted his keyword collections within an FCPX file and am sharing it here for easy access for anyone who, like me, would find it helpful.
- Simply download the ZIP FILE to your computer and then extract it.
- Double click and open the
wedding_keywords_import.fcpxml
file which will open up Final Cut and will ask to add it as project as a new event OR you can use the import xml menu option (File → Import → XML) within Final Cut Pro X.
- Create python virtual environment in a folder:
- UNIX:
python3 -m venv env
- WINDOWS:
py -m venv env
- UNIX:
- Activate Environment:
- UNIX:
source env/bin/activate
- WINDOWS:
.\env\Scripts\activate
- UNIX:
- Optional:
python -m pip install --upgrade pip
- Place
copy.py
file in directory - Run Script (within venv):
python copy.py
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
{ | |
"title": "Final Cut Razer Key Bindings", | |
"rules": [ | |
{ | |
"description": "e-9 => ⌥ ] - Trim Start", | |
"manipulators": [ | |
{ | |
"type": "basic", | |
"from": { | |
"key_code": "e" |
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
#!/bin/bash | |
#get the current date | |
SNAME="$(wp eval 'printf("%s_%d", sanitize_title(site_url()), date("ymdHis"));')" | |
# set archive backup name and append the date | |
# eg: https-mywebsite-com_220321051310.zip | |
SITEBKUPNAME="$SNAME.zip" | |
# export database |