This file contains 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
$ node scripts/calculateWorkHours.js | |
Total work hours: 98.77 hours | |
Average hours per day: 3.74 hours |
This file contains 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
async function calculateWorkHours() { | |
try { | |
const commits = await getCommitLog(); | |
if (commits.length === 0) { | |
console.log('No commits found in this repository.'); | |
return; | |
} | |
let totalWorkTime = 0; |
This file contains 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
async function calculateWorkHours() { | |
try { | |
const commits = await getCommitLog(); | |
if (commits.length === 0) { | |
console.log('No commits found in this repository.'); | |
return; | |
} | |
let totalWorkTime = 0; |
This file contains 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
const simpleGIT = require('simple-git'); | |
const git = simpleGIT(); | |
async function getCommitLog() { | |
try { | |
const log = await git.log(); | |
return log.all; | |
} catch (error) { | |
console.error('Error fetching commit log:', error); | |
} |
This file contains 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
python3 script.py --source manga.cbr --output comic_folder |
This file contains 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
python3 script.py --source manga_folder --output comic_folder |
This file contains 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
python3 script.py --source manga_page.jpg --output comic_folder |
This file contains 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
pip install -r requirements.txt |
This file contains 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
def do_task(base_image, final_output_image_path): | |
if isinstance(base_image, str): | |
base_image = Image.open(base_image) | |
extracted_text = extract_text_from_manga(base_image) | |
base_image = Image.open(base_image) if isinstance(base_image, str) else base_image | |
transparent_image = create_image_with_inverted_text_placement(base_image, extracted_text) | |
overlay_flipped_with_transparent(base_image, transparent_image, final_output_image_path) |
This file contains 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
def overlay_flipped_with_transparent(base_image, transparent_image, final_output_image_path='final_output_image.png'): | |
flipped_base_image = base_image.transpose(Image.FLIP_LEFT_RIGHT).convert('RGBA') | |
if transparent_image.mode != 'RGBA': | |
transparent_image = transparent_image.convert('RGBA') | |
combined_image = Image.alpha_composite(flipped_base_image, transparent_image) | |
if final_output_image_path.lower().endswith('.jpg') or final_output_image_path.lower().endswith('.jpeg'): | |
combined_image = combined_image.convert('RGB') |
NewerOlder