Skip to content

Instantly share code, notes, and snippets.

View LuisMayo's full-sized avatar

Luis Mayo Valbuena LuisMayo

View GitHub Profile
@LuisMayo
LuisMayo / instructions.md
Last active July 8, 2022 22:12
Instructions to generate subtitles in SubRip(SRT) format for a given media

Here are instructions for generating an SRT file with the transcript of a media file given the URL of that file. In order to achive our goal we're going to use Google Cloud Run(GCRun, a part of the Google Cloud(GC) enviorenmentent (avaiable in "Always free tier)

Credits

Some part of this instructions, as well as the original idea has been obtained from vxlabs

Steps

  1. Create a Google Cloud Project or select one: https://console.cloud.google.com/
  2. Enable Speech To Text API for your project
debugVariableWriting = function (object, propertyName) {
object['_' + propertyName] = object[propertyName]
Object.defineProperty(object, propertyName, {
get: function() {
console.log('get!');
return this['_' + propertyName];
},
set: function(val) {
debugger;
this['_' + propertyName] = val;
debugPrimitive = function (obj, fn) {
obj['_' + fn] = obj[fn];
obj[fn] = function (arg) {
debugger;
this.fn(arg);
}
}
@LuisMayo
LuisMayo / button-keyboard-helper.ts
Created June 28, 2020 17:08
Keyboard helper for Telegraf
import * as Telegraf from 'telegraf';
import { CallbackButton, Button } from 'telegraf/typings/markup';
export class ButtonKeyBoardHelper {
buttons: (CallbackButton | Button)[][] = [];
lastArr = [];
charactersInCurrentLine = 0;
constructor() {
this.buttons.push(this.lastArr);
javascript:(function () { if (location.hostname !== 'elpais.com') { location.href = 'https://elpais.com/'; } if (localStorage) { const serializedArcp = localStorage.getItem('ArcP'); if (serializedArcp && serializedArcp.length > 0) { const arcp = JSON.parse(serializedArcp); arcp.anonymous.rc[Object.keys(arcp.anonymous.rc)[0]].c = -200; localStorage.setItem('ArcP', JSON.stringify(arcp)); location.reload(); } } })();
@LuisMayo
LuisMayo / unblock.js
Created May 28, 2021 15:05
Unblockk al people from twitter
function unblock() {
setInterval(() => {
// It may not properly work if Twitter updates the webpap since it seems ofuscated
let foo = document.querySelectorAll('.r-1dgebii')
foo.forEach(btn => btn.click());
console.log
foo[foo.length - 1].scrollIntoView()
}, 700);
}
unblock()
@LuisMayo
LuisMayo / coh-notes.md
Last active April 6, 2022 22:29
Notes about clash of heroes bugs

Bugs

Ilegal saving.

Ilegal saving has proven itself worthy of several side-effects. Like cutscene characters duplicating, game crashes and (Extended) battle bypass. You perform ilegal saving by opening the pause menu using the back button on your android device. Note that the ingame pause button is non-existent or disabled when you cannot save, like in cutscenes and animations, but the back button will open the pause menu anyway

Battle bypass

BB is performed by saving the game while we are on the walking animation towards a node occupied by an enemy. After reloading the game, the enemy will be dead. Sometimes it's still alive but their death consequences will fire (giving you an object, letting you go past them, etc). This may be because the game on loading interprets you being in a node where an enemy should be as you having won the fight. Battles bypassable with BB will be called Type 1

Extended Battle Bypass

@LuisMayo
LuisMayo / ffmpeg-yt-dlp-cheatsheet.md
Last active April 14, 2022 19:08
FFMPEG and yt-dlp flags and useful commands

FFMPEG

Merge video and subtitles into mkv file

ffmpeg -hwaccel auto -i aa.mp4 -i aa.srt -c copy aa.mkv

Vobsubs (.idx and .sub)

Select the .idx file. Ffmpeg will automatically search for the .sub file. Just another audio stream.

Mapping

https://trac.ffmpeg.org/wiki/Map