Skip to content

Instantly share code, notes, and snippets.

View hieblmedia's full-sized avatar

Reinhard Hiebl // OverTheClock hieblmedia

View GitHub Profile
hieblmedia / .htaccess
Last active June 8, 2021 09:00
no-index header (X-Robots-Tag) + robots.txt for Develop/Testing/Stating subdomains
# Set X-Robots-Tag
<If "%{HTTP_HOST} =~ /^(develop|dev|test|testing|stage|staging)\./">
Header set X-Robots-Tag "noindex, nofollow"
<IfModule mod_rewrite.c>
# Enable URL rewriting
RewriteEngine On
# ....
hieblmedia / matchBreakpoint.js
Created May 7, 2020 17:05
Javascript to check (Bootstrap 4) breakpoints based on CSS variables
function matchBreakpoint(breakpoint) {
var value = window.getComputedStyle(document.documentElement).getPropertyValue('--breakpoint-' + breakpoint);
return window.matchMedia("(min-width: " + value + ")").matches;
// Example:
// matchBreakpoint('md') ? 'its md' : 'meh';
// You can also use this if you provide CSS variables with --breakpoint-[breakpoint] in your custom CSS or on other frameworks.
// It's simple to adapt.
hieblmedia /
Created January 18, 2017 01:03
This gist will show you how to build a minimalist, statically-linked ffmpeg binary under the ~/bin subdirectory on your home on Ubuntu 16.04LTS.

Minimalist static FFmpeg build on Ubuntu 16.04 with Nvidia NVENC enabled.

Original guide with a standard build is here.

With this guide, I'm adding more instructions to enable support for NVIDIA CUVID and NVIDIA NPP for enhanced encode and decode performance.

First, prepare for the build and create the work space directory:

cd ~/

hieblmedia / php.bat
Created December 4, 2015 23:25
Dynamic PHP executabe for wampserver depend on current enabled version. [tested on Windows10 with Wampserver3_x86]
@REM This file detects the current enabled PHP version of wampserver ( and executes the enabled php.exe and all parameters are passed
@REM Copy this file to WAMPSERVERPATH\bin\php
@REM Now you can add WAMPSERVERPATH\bin\php to your Windows Environment-Variable "PATH". Now you can use "php" global. For example "php -v".
@REM You can show the current PHP version with "php -v"
@setlocal enableextensions enabledelayedexpansion
@echo off
set serverPath="%~dp0\..\.."
set file="!serverPath!\wampmanager.conf"
hieblmedia / gist:29c93d3b45e4da97147c
Created February 20, 2015 15:37
Detect Adblock using user and log in Analytics
// Found here:
window.onload = function() {
// Delay to allow the async Google Ads to load
setTimeout(function() {
// Get the first AdSense ad unit on the page
var ad = document.querySelector("ins.adsbygoogle");
var IE = (function() {
if (document.documentMode) {
return document.documentMode;
} else {
for (var i = 7; i > 4; i--) {
var div = document.createElement("div");
div.innerHTML = "<!--[if IE " + i + "]><span></span><![endif]-->";
if (div.getElementsByTagName("span").length) {
hieblmedia / .gitignore
Last active June 24, 2024 07:30
Gitignore - Exclude all except specific subdirectory
# If all files excluded and you will include only specific sub-directories
# the parent path must matched before.
# Un-ignore the affected subdirectory
// debouncing function from John Hann
var debounce = function (func, threshold, execAsap) {
var timeout;
return function debounced () {
var obj = this, args = arguments;
function delayed () {
hieblmedia / prototype.bind.polyfill.js
Created January 23, 2014 11:48
Function.prototype.bind Polyfill (Performace optimized:
* Polyfill for Function.prototype.bind
* (bind)[]
* (You don't need to use $.proxy)[]
* Credits: taken from bind_even_never in this discussion:
if (typeof Function.prototype.bind !== "function") {
Function.prototype.bind = function(context) {
var fn = this, args =, 1);
return function(){