Skip to content

Instantly share code, notes, and snippets.

View mayeaux's full-sized avatar
💭
Coding

Anthony mayeaux

💭
Coding
View GitHub Profile
@rBrenick
rBrenick / split_subtitle_file_into_multiline.py
Last active September 12, 2024 23:32
Take an .srt file and split the text line if the character count goes above a certain threshold.
import sys
import argparse
"""
Example usecase:
python split_srt_lines.py SUBTITLE_FILE_PATH.srt -o OUTPUT_FILE_PATH.srt --max_line_length=42 --comma_split_percent=75
if you don't specify an output path, it will replace the file content of the input file
@hexxone
hexxone / main.py
Last active January 25, 2021 12:46 — forked from gurland/main.py
!!! DEPRECATED !!! DONT USE THIS IF YOU DON'T KNOW WHAT YOURE DOING !!!
# Copyright (c) 2017 Stanislav Bobokalo & Alexey Borontov & Dominic T
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
@stevecondylios
stevecondylios / resize-image-in-github-issue-github-flavored-markdown.md
Last active October 26, 2024 22:13
How to Resize an Image in a Github Issue (e.g. Github flavored Markdown)

How to Resize an Image in Github README.md (i.e. Github Flavored Markdown)

Percentage:

<img src="https://user-images.githubusercontent.com/16319829/81180309-2b51f000-8fee-11ea-8a78-ddfe8c3412a7.png" width=50% height=50%>

Pixels:

<img src="https://user-images.githubusercontent.com/16319829/81180309-2b51f000-8fee-11ea-8a78-ddfe8c3412a7.png" width="150" height="280">

@gmolveau
gmolveau / embed_sub.md
Last active October 16, 2024 15:24
Embed subtitle (soft) in mp4/mkv file with ffmpeg without re-encoding

solution from https://stackoverflow.com/a/17584272/2627873

This solution adds the subtitles to the video as a separate optional (and user-controlled) subtitle track.

So you can choose the subtitle in VLC for example, it's not hard-coded or burned-in. And it won't re-encode the entire file so it's really fast.

  • ffmpeg is required
  • movie = great_movie.mp4 (works with mkv too)
  • subtitle = great_movie.english.srt
@heshamelmasry77
heshamelmasry77 / Error: Message failed: 553 Relaying disallowed as @ the solution NodeMail Zoho
Last active August 2, 2023 14:23
Error: Message failed: 553 Relaying disallowed as @ the solution NodeMail Zoho
After searching for more than 6 hours trying to understand what is zoho's mail problem to send emails!
After i red lots lots of there answer with no helpul solution i found the issue was that you need to have the ``` sender ``` option
in your nodemailer option same like email with same sender name and sender email. like this : ``` from: '"senderNameSameLikeTheZohoOne" <emailname@yourwebsite.com>',```
my config :
```
const transporter = nodemailer.createTransport({
service:'Zoho',
host: 'smtp.zoho.com',
port: 465,
ssh my-ssh-user@ip.to.my.server.com -L <ANY_AVAILABLE_PORT_YOU_FANCY>:127.0.0.1:39017 -N
@przemoc
przemoc / youtube-sort-videos-by-length.md
Last active October 14, 2024 14:40
Bookmarklet for YouTube: Sort videos by length in videos tab

Bookmarklet for YouTube: Sort videos by length in videos tab

On channels in videos tab you can sort videos by:

  • Most popular
  • Date added (oldest)
  • Date added (newest)

But you cannot sort by length. So I decided to create a bookmarklet to do it in ascending order.

@ivandru
ivandru / send.py
Created January 4, 2019 16:22
Simple Ether Transfer on Ropsten
import web3
import json
from eth_account import Account
from web3 import Web3
w3 = Web3(Web3.HTTPProvider('https://ropsten.infura.io/v3/apiKey'))
acct = Account.privateKeyToAccount('private key')
nonce = w3.eth.getTransactionCount(acct.address)
transaction = {
'to' : toAccount,
'value': 1,
@vicke4
vicke4 / twitter-poll-result.js
Last active November 19, 2022 14:42
Bookmarklet to view Twitter poll result without voting
/**
* Used https://www.odditysoftware.com/page-webtools16.htm to remove comments and minify the code to use it as a bookmarklet
*/
(
function () {
/* Exiting if the webpage is not Twitter or a valid tweet */
if (window.location.origin !== 'https://twitter.com' || window.location.pathname.split('/').length !== 4) return alert('This is not a valid Twitter poll!');
alert('Please wait this can take up to 30 seconds. Select OK or close to get started. If this is a valid poll, you will get the result when it is ready...:)');