Skip to content

Instantly share code, notes, and snippets.

View syntaxhacker's full-sized avatar
🧠
upgrading...

Rohit J syntaxhacker

🧠
upgrading...
View GitHub Profile
@MarkBennett
MarkBennett / installing-ruby-2.5.1-on-m1.md
Last active March 23, 2024 10:21
Installing Ruby 2.5 on Mac M1
@GlauberF
GlauberF / KeyEventSimulator.js
Created April 29, 2020 10:28
A function for simulating key event in JavaScript. You just have to choose what key and keyboard event you want to simulate.
/**
* Simulate a key event.
* @param {Number} keyCode The keyCode of the key to simulate
* @param {String} type (optional) The type of event : down, up or press. The default is down
* @param {Object} modifiers (optional) An object which contains modifiers keys { ctrlKey: true, altKey: false, ...}
*/
function simulateKey (keyCode, type, modifiers) {
var evtName = (typeof(type) === "string") ? "key" + type : "keydown";
var modifier = (typeof(modifiers) === "object") ? modifier : {};
# /usr/bin/env python
#
# Author: Red5d
#
# Description: Extract and run OCR on subtitles from a PGS-format .sup file.
#
# Example Usage: python sup2srt.py bd_subtitles.sup bd_subtitles.srt
#
# Dependencies:
# - pytesseract
@tigefa4u
tigefa4u / ffmpeg.md
Created August 18, 2018 01:06 — forked from Orangestar12/ffmpeg.md
personal quick ffmpeg cheat sheet

These are a few quick easy ffmpeg command lines that can be used to make oft-used video formats. I use them a lot so I wrote them down in a txt file but I converted it to markdown to upload here and access on all my pcs.

Feel free to use 'em. I've gathered them through superuser posts, wiki trawls, and personal experience.

General notes

  • Add -movflags faststart to make mp4 files have their headers at the beginning of the file, allowing them to be streamed (i.e. played even if only part of the file is downloaded).
  • mp4 container supports mp3 files, so if libfdk_aac isnt available (it's the only good aac enc) use libmp3lame.
  • For mp4 files, use -preset X to use mp4 enc presets, like slow or superfast. (veryfast or fast is ok)
  • c:v refers to the video codec used (codec: video). Likewise, c:a is audio. If you're using -map or something, this can be extended (-c:a:0: codec: audio: stream 0)
@stasgavrylov
stasgavrylov / SvgIcon.css
Created April 22, 2018 11:14
React SVG wrapper component
svg {
fill: white;
stroke: currentColor;
}
@dvlden
dvlden / ffmpeg.md
Last active April 17, 2024 19:53
Convert video files to MP4 through FFMPEG

This is my personal list of functions that I wrote for converting mov files to mp4!

Command Flags

Flag Options Description
-codec:a libfaac, libfdk_aac, libvorbis Audio Codec
-quality best, good, realtime Video Quality
-b:a 128k, 192k, 256k, 320k Audio Bitrate
-codec:v mpeg4, libx264, libvpx-vp9 Video Codec
@shospodarets
shospodarets / Chrome headless Puppeteer- capture DOM element screenshot using
Last active January 17, 2023 18:52
Chrome headless Puppeteer- capture DOM element screenshot using
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
// Adjustments particular to this page to ensure we hit desktop breakpoint.
page.setViewport({width: 1000, height: 600, deviceScaleFactor: 1});
await page.goto('https://www.chromestatus.com/samples', {waitUntil: 'networkidle'});
@garoto
garoto / ffmpeg-hevc-encode-nvenc.md
Created July 10, 2017 17:15
This gist shows you how to encode specifically to HEVC with ffmpeg's NVENC on supported hardware, with a two-pass profile and optional CUVID-based hardware-accelerated decoding.

Encoding high-quality HEVC content with FFmpeg - based NVENC encoder on supported hardware:

If you've built ffmpeg as instructed here on Linux and the ffmpeg binary is in your path, you can do fast HEVC encodes as shown below, using NVIDIA's NPP's libraries to vastly speed up the process.

Now, to do a simple NVENC encode in 1080p, (that will even work for Maxwell Gen 2 (GM200x) series), start with:

ffmpeg  -i <inputfile>  \
-filter:v hwupload_cuda,scale_npp=w=1920:h=1080:format=nv12:interp_algo=lanczos,hwdownload \

-c:v hevc_nvenc -profile main -preset slow -rc vbr_hq \

@torresashjian
torresashjian / linux-kali-install-wifi-drivers.sh
Last active April 16, 2024 15:40
How to install Broadcom BCM43142 Drivers on Kali Linux
apt-get update
apt-get install linux-image-$(uname -r|sed 's,[^-]*-[^-]*-,,') linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') broadcom-sta-dkms
modprobe -r b44 b43 b43legacy ssb brcmsmac bcma
modprobe wl
@gevorg
gevorg / index.html
Last active July 3, 2020 19:21
Video Streaming
<video width="400" height="300" autoplay controls>
<source src="video.mp4" type="video/mp4">
</video>
<video width="400" height="300" autoplay controls>
<source src="video2.mp4" type="video/mp4">
</video>