Applications


Beamer: Reasons to avoid allowframebreaks

Recently we were relying too much on allowframebreaks to automatically split a frame to multiple slides.

We were trying to make our notes spread across all slides that were automatically generated. After reading the Beamer User Guide, we learned a couple of new things.

A) Once you use allowframebreaks then you cannot use overlays.

B) Any notes for the frame created using the \note command will be inserted after the first page of the frame and will not be split among other pages.

C) We should refrain from using the option allowframebreaks except for long bibliographies (which by the way should be avoided anyway in presentations).

D) The use of this option is evil ^___^ as it promotes bad design and lack of thought when creating a presentation.

Anyway, back to the drawing board!


ffmpeg: Cut out a part of a video

Following is a snippet we used to remove a few seconds from a video using ffmpeg

ffmpeg -i 'input.mkv' -filter_complex \
  "[0:v]trim=end=553,setpts=N/FRAME_RATE/TB[v0]; \
   [0:a]atrim=end=553,asetpts=N/SR/TB[a0]; \
   [0:v]trim=start=559,setpts=N/FRAME_RATE/TB[v1]; \
   [0:a]atrim=start=559,asetpts=N/SR/TB[a1]; \
   [v0][a0][v1][a1]concat=n=2:v=1:a=1[v][a]" \
  -map "[v]" -map "[a]" 'output.mkv'

Specifically, we removed the seconds 09:13 (second 553) to 09:19 (second 559).


Manually Start an Infinite Scroll on a browser without using a plugin 1

Recently, we needed to perform an infinite scroll on a website so that it would load all of its resources (both text and images). As the website was too long and it would take hours to manually scroll little by little, we used the Firefox console and JavaScript to perform the scroll without any additional plugins.

To do so we followed these steps: First we pressed the F12 button to enable the build-in console of Firefox.

Then, we typed allow pasting in the console to enable the ability to paste code directly into the console editor. Once we did that, we deleted the text allow pasting as it would create a problem once we run our code later on.

Following, we pasted the following code which both defines the function that performs the infinite scroll and the call that starts it.

//To avoid naming conflicts, give a non common names to the function and variable
var bytefreaksTimeout;

function bytefreaksScroll() {
    window.scrollBy(0,1);
    bytefreaksTimeout = setTimeout(bytefreaksScroll,10);
}

bytefreaksScroll();

As you will see in the following video, the scrolling was working flawlessly, once the scrolling reached the place we needed it to we used the following line in the console to stop the scrolling.

clearTimeout(bytefreaksTimeout);