Skip to content

Instantly share code, notes, and snippets.

View alarian's full-sized avatar

Jordan Wright alarian

  • Irving, TX
View GitHub Profile
@alarian
alarian / ffmpeg-hevc-encode-nvenc.md
Created April 19, 2019 21:15
This gist shows you how to encode specifically to HEVC with ffmpeg's NVENC on supported hardware, with an optional CUVID-based hardware-accelerated decoder.

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 scale_npp=w=1920:h=1080:format=nv12:interp_algo=lanczos \

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

@alarian
alarian / comments.json
Last active November 6, 2019 03:38 — forked from piscisaureus/pr.md
Checkout github pull requests locally
[
{
"author_association": "NONE",
"body": "LOVELY.\n",
"created_at": "2012-08-13T16:49:05Z",
"id": 397376,
"node_id": "MDExOkdpc3RDb21tZW50MzM0MjI0NzozOTczNzY=",
"updated_at": "2012-08-13T16:49:05Z",
"url": "https://api.github.com/gists/3342247/comments/397376",
"user": {
{"lastUpload":"2022-05-12T17:45:15.464Z","extensionVersion":"v3.4.3"}
@alarian
alarian / file-svg-export.py
Created February 9, 2021 17:41 — forked from thorsummoner/file-svg-export.py
GIMP Plug-in for Simple SVG Exports
#!/usr/bin/env python
# GIMP Plug-in for Simple SVG Exports
# Copyright (C) 2016 by Dylan Grafmyre <thorsummoner@live.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
@alarian
alarian / firefox-devtools.md
Created February 10, 2021 00:54 — forked from vbsessa/firefox-devtools.md
How to customize Firefox devtools fonts
  1. Open ~/.mozilla/firefox/<your_profile>/chrome/userChrome.css (create it if does not exist).

  2. Paste the following content in it.

     @namespace url(http://www.w3.org/1999/xhtml);
     @-moz-document regexp("chrome://browser/content/devtools/**/.*"){
         .devtools-monospace {
             font-family: Consolas, monospace !important;
             font-size: 8pt !important;
         }
    

}

@alarian
alarian / chrome-devtools.md
Created February 10, 2021 00:54 — forked from vbsessa/chrome-devtools.md
How to customize Chrome devtools fonts
  1. Enable #enable-devtools-experiments flag in chrome://flags section.

  2. Open Chorme Devtools and check Settings > Experiments > Allow custom UI themes.

  3. Create the following four files in a dedicated folder.

    3.1. devtools.html

    <html>
    <head></head>
    <body><script src="devtools.js"></script></body>
@alarian
alarian / unicode-notez.md
Last active March 10, 2021 18:35
unicode symbols & notez
<style> h1 { color: red; } </style>

Unicodez


@alarian
alarian / Remove-ThisPCFolders.reg
Created March 15, 2021 22:28
Remove Folders from This PC
Windows Registry Editor Version 5.00
; Pictures Folder
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}\PropertyBag]
"ThisPCPolicy"="Hide"
; Videos Folder:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag]
"ThisPCPolicy"="Hide"
@alarian
alarian / Revealing-Module-Pattern.md
Created April 7, 2021 23:37 — forked from zcaceres/Revealing-Module-Pattern.md
Using the Revealing Module Pattern in Javascript

The Revealing Module Pattern in Javascript

Zach Caceres

Javascript does not have the typical 'private' and 'public' specifiers of more traditional object oriented languages like C# or Java. However, you can achieve the same effect through the clever application of Javascript's function-level scoping. The Revealing Module pattern is a design pattern for Javascript applications that elegantly solves this problem.

The central principle of the Revealing Module pattern is that all functionality and variables should be hidden unless deliberately exposed.

Let's imagine we have a music application where a musicPlayer.js file handles much of our user's experience. We need to access some methods, but shouldn't be able to mess with other methods or variables.

Using Function Scope to Create Public and Private Methods

Use of keys like Alt, Ctrl, Esc is necessary for working with a CLI terminal. Termux touch keyboards do not include one. For that purpose Termux uses the Volume down button to emulate the Ctrl key. For example, pressing}Volume down+L on a touch keyboard sends the same input as pressing Ctrl+L on a hardware keyboard.
The result of using Ctrl in combination with a key depends on which program is used, but for many command line tools the following shortcuts works:
Ctrl+A → Move cursor to the beginning of line
Ctrl+C → Abort (send SIGINT to) current process
Ctrl+D → Logout of a terminal session
Ctrl+E → Move cursor to the end of line
Ctrl+K → Delete from cursor to the end of line
Ctrl+U → Delete from cursor to the beginning of line