Skip to content

Instantly share code, notes, and snippets.

View JoeSz's full-sized avatar

Joe JoeSz

View GitHub Profile
@JoeSz
JoeSz / responsive_page_like.html
Last active March 16, 2023 16:58
Responsive Facebook Page Like Box
<!DOCTYPE HTML>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"></script>
</head>
<body>
<div id="fb-container" style="width:100%;">
<div class="fb-page" data-href="https://www.facebook.com/facebook" data-height="160" data-small-header="true" data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true"></div>
</div>
@JoeSz
JoeSz / index.html
Created October 19, 2016 09:43
Basic HTML5 boilerplate with FontAwesome and Bootstrap.
<!doctype html>
<html lang="en">
<head>
<!--
ToDo: HTML, CSS, JS -> concatenate and minify for production
- JavaScript: https://jscompress.com/
- CSS: http://www.cleancss.com/css-minify/
- HTML: http://www.willpeavy.com/minifier/
@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 / change-url-while-scrolling.html
Created September 24, 2016 15:48
Detect element is in the viewport and then change browser url
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Scrolling URL Hash</title>
<meta name="description" content="Webpage for xxxx">
<style>
body {
height: 2000px;
}
@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 / isElementInViewport.js
Last active November 5, 2021 09:14
isElementInViewport and isElementPartiallyInViewport
/*
* http://stackoverflow.com/questions/123999/how-to-tell-if-a-dom-element-is-visible-in-the-current-viewport/26039199#26039199
*/
function isElementPartiallyInViewport(el)
{
//special bonus for those using jQuery
if (typeof jQuery !== 'undefined' && el instanceof jQuery) el = el[0];
var rect = el.getBoundingClientRect();
// DOMRect { x: 8, y: 8, width: 100, height: 100, top: 8, right: 108, bottom: 108, left: 8 }

Highlight keywords of text on hover

Just a little experiment. When hovering over the article with your mouse, some keywords from the text should be easy readable while the rest should be darker.

A Pen by Bas Groothedde on CodePen.

License.

@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/
*
*/