Skip to content

Instantly share code, notes, and snippets.

View sethwololo's full-sized avatar

Matheus Bezerra sethwololo

  • Senado Federal
  • Brazil
View GitHub Profile
@jeffpamer
jeffpamer / encode.sh
Created March 16, 2018 19:38
Smooth Scrubbing Web Video FFMPEG Mega Command
ffmpeg -i input.mp4 -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -level 3 -an -vf "scale=-1:1440, reverse" -preset veryslow -g 2 output.mp4
// -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -level 3
// Encode for web with a good balance of browser compatibility and compression ratio
// -an
// Strip audio tracks
// -vf "scale=-1:1440, reverse"
// Scale video to 1440px wide, maintaining aspect ratio
@vlucas
vlucas / encryption.ts
Last active March 3, 2025 09:07
Stronger Encryption and Decryption in Node.js
import { createCipheriv, createDecipheriv, randomBytes } from "crypto";
const ENCRYPTION_KEY: string = process.env.ENCRYPTION_KEY || ""; // Must be 256 bits (32 characters)
const IV_LENGTH: number = 16; // For AES, this is always 16
/**
* Will generate valid encryption keys for use
* Not used in the code below, but generate one and store it in ENV for your own purposes
*/
export function keyGen() {