Skip to content

Instantly share code, notes, and snippets.

View titusfx's full-sized avatar

Mauricio Jorge Cordeiro Garrido titusfx

View GitHub Profile
@titusfx
titusfx / window_info_interactive.py
Created March 6, 2022 23:22
Get windows dimension and location in python with xdotool
# You need to install
# sudo apt-get install -y xdotool
import subprocess
import re
def clean_output(output_b):
return output_b.decode("utf-8").strip().split("\n")
@titusfx
titusfx / launch.json
Last active December 18, 2023 23:40
Django configuration to Debug built in commands and Custom ones on VSCode
{
"version": "0.2.0",
"configurations": [ {
"name": "Django Command",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/manage.py",
"args": [
"${input:commandToRun}",
],
@titusfx
titusfx / background.js
Created August 4, 2021 13:36
Paste te Result of your clipboard on a console.
/*
Paste te Result of your clipboard on a console.
In background.js of a chrome extension and permission of clipboardRead and clipboardWrite on the manifest
*/
setInterval(()=>{
let tempT = document.querySelector('#clipboard');
let textArea = !!tempT ? tempT : document.createElement("textarea");
textArea.id = 'clipboard'
document.body.appendChild(textArea);
textArea.select();
@titusfx
titusfx / script.js
Last active June 13, 2021 10:12
Script to run on google sheet with specific functionality
function generatePageSheet() {
let mainSheetName = "input - Price Table"; // Name of the sheet that will be read
let sheet = SpreadsheetApp.getActive().getSheetByName(mainSheetName);
let data = sheet.getDataRange().getValues(); // Getting the values data is 18 rows and 14 columns. The first row has two empty values and then the list
const [matrixPircesGaps, matrixPricesExtended] = fillMatrix(data);
name = 'Generated Output'
// let genSheet = sheet.insertSheet(name);
@titusfx
titusfx / .js
Last active April 8, 2020 15:07
How to dowload a video from wistia just with copying and paste this script on the console of your browser
/* This is an automation of this process explained in this video https://www.youtube.com/watch?time_continue=89&v=88eHpwLS_aQ&feature=emb_logo */
let allContent = document.getElementsByTagName('body')[0].innerHTML;
const keyWord = 'wistia_async_';
let asyncTextIndex = allContent.indexOf(keyWord);
let asyncEndIndex = allContent.indexOf(" ", asyncTextIndex);
let codeIndex = asyncTextIndex + keyWord.length;
let codeLength = asyncEndIndex - asyncTextIndex - keyWord.length;
let code = allContent.substr(codeIndex, codeLength);
let fastUrl = `https://fast.wistia.net/embed/iframe/${code}`
let finalUrl = `https://getvideo.at/?url=${encodeURIComponent(fastUrl)}&utm_source=bookmarklet&utm_medium=redirect`;