Skip to content

Instantly share code, notes, and snippets.

View JoeSz's full-sized avatar

Joe JoeSz

View GitHub Profile
@JoeSz
JoeSz / extractMkvSubtitles.sh
Last active November 19, 2022 17:29 — forked from cinatic/extractMkvSubtitles.sh
Extract Subtitles from mkv
#!/bin/bash
# Extract subtitles from each MKV file in the given directory
path=$PWD
echo
echo -e "\033[33mWould you like to extract subtitles from each MKV file in the directory?\033[m"
echo -e "Folder: ${path}"
echo -e "(yes/no)"
read -p ""
@JoeSz
JoeSz / Restore the GRUB Bootloader.md
Created February 1, 2022 17:01 — forked from dianjuar/Restore the GRUB Bootloader.md
Restore the GRUB Bootloader on Manjaro Linux. Usefull when your fresh windows install eats your grub and can not boot into your linux installation, or for some how your grub is missing

Restore the GRUB Bootloader on Manjaro

  1. Chroot into your linux instalation
    1. The easiest way is with mhwd-chroot
      1. Install it yaourt -S mhwd-chroot
      2. Run it sudo mhwd-chroot
      3. DONE, you have chrooted into your linux installation (open a root console of your installed linux OS, is like just open a console with root access)
  2. Restore your GRUB
    1. Install a new GRUB bootloader with grub-install /dev/sda
  3. Recheck to ensure the that installation has completed without any errors grub-install --recheck /dev/sda
@JoeSz
JoeSz / VAAPI-hwaccel-encode-Linux-Ffmpeg&Libav-setup.md
Created January 24, 2022 19:22 — forked from Brainiarc7/VAAPI-hwaccel-encode-Linux-Ffmpeg&Libav-setup.md
This gist contains instructions on setting up FFmpeg and Libav to use VAAPI-based hardware accelerated encoding (on supported platforms) for H.264 (and H.265 on supported hardware) video formats.

Using VAAPI's hardware accelerated video encoding on Linux with Intel's hardware on FFmpeg and libav

Hello, brethren :-)

As it turns out, the current version of FFmpeg (version 3.1 released earlier today) and libav (master branch) supports full H.264 and HEVC encode in VAAPI on supported hardware that works reliably well to be termed "production-ready".

@JoeSz
JoeSz / functions.php
Created December 9, 2020 13:35 — forked from alexwcoleman/functions.php
WordPress: Redirect single custom post type to archive page.
// redirect single posts to the archive page, scrolled to the current member.
// * this is for a post type of "board_member"
add_action( 'template_redirect', function() {
if ( is_singular('board_member') ) {
// I used the two variables to put the member's name as the ID of the article
// so the redirect would automatically scroll. This can be removed.
$title = get_the_title();
$url_append = str_replace( ' ', '-', strtolower($title) );
global $post;
$redirectLink = get_post_type_archive_link( 'board_member' ) . "#" . $url_append;
/**
* jQuery iLightBox - Revolutionary Lightbox Plugin
* http://www.ilightbox.net/
*
* @version: 2.2.3 - June 03, 2017
*
* @author: Hemn Chawroka
* http://www.iprodev.com/
*
*/
@JoeSz
JoeSz / loop-custom.php
Created June 17, 2020 07:03 — forked from kevinwhoffman/loop-custom.php
WordPress - Custom Post Type Loop
<?php
$loop = new WP_Query( array(
'post_type' => 'Property',
'posts_per_page' => -1
)
);
?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
\index.php
\wp-blog-header.php
\wp-load.php
\wp-config.php
\wp-settings.php
\wp-includes\load.php
\wp-includes\default-constants.php
\wp-includes\version.php
\wp-includes\compat.php
\wp-includes\random_compat\random.php
@JoeSz
JoeSz / listing-18-2.php
Created September 4, 2019 08:09 — forked from WordPress-Handbuch/listing-18-2.php
WordPress hook to activate a basic maintenance mode showing a message for everybody but the administrator
function wh_maintenance_mode() {
if ( !is_user_logged_in() || !current_user_can('administrator') ) {
wp_die( 'Dritte Variante einer Wartungsseite', 'Wartung!', array( 'response' => '503'));
}
}
add_action( 'get_header', 'wh_maintenance_mode' );
@JoeSz
JoeSz / listing-10-2.php
Created September 4, 2019 07:53 — forked from WordPress-Handbuch/listing-10-2.php
PHP/HTML blog snippet for proper WordPress HTML meta tag integration for social network sharing
<?php
if (is_single())
{
$title = htmlspecialchars( strip_tags( get_the_title( $post->ID ) ) );
$description = htmlspecialchars( strip_tags( get_the_excerpt( $post->ID ) ) );
$thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' );
$image = $thumbnail[0];
$type = 'article';
} elseif (is_page()) {
$title = htmlspecialchars( strip_tags( get_the_title( $post->ID ) ) );
@JoeSz
JoeSz / links.md
Created July 5, 2019 08:01 — forked from addyosmani/links.md
this.performance links