Skip to content

Instantly share code, notes, and snippets.

View aeharding's full-sized avatar
🪂
Flying

Alexander Harding aeharding

🪂
Flying
View GitHub Profile
@4np
4np / WKWebView-and-AVPlayer.md
Created April 5, 2019 11:17
Detecting Video Playback inside a WKWebView

Detecting Video Playback inside a WKWebView

Observing video playback inside a black-boxed WKWebView is difficult as you don't have direct access to the video player.

Another complicating matter is that depending on the video, the video might be played using a HTML5 video player, while others might launch the native AVPlayerViewController for playback. While it might be possible to detect HTML5 based playback by injecting custom JavaScript using a WKUserContentController, this is not the approach we will follow in the document as these depend on what HTML5 Video Player is involved and is, as such, not a generic solution.

Making sure AVKit is used

@mrcoles
mrcoles / pause-gifs.css
Created February 15, 2018 18:22
A lightweight approach to pausing gifs on a webpage.
/** .pause-gif */
.wrap-pause-gif {
position: relative;
text-align: center;
}
.pause-gif {
visibility: hidden;
}
@janoskk
janoskk / couchclone.sh
Created May 28, 2014 22:27
Create (if necessary) and replicate all databases from a couchdb server to another one
#!/bin/sh
#
# Janos Kasza (@janoskk)
#
# Creates (if necessary) and replicates all databases from a couchdb server to another one
#
if [ -z "$2" ]; then
cat <<EOF
Usage: $0 <sourceUrl> <targetUrl>
@mrflix
mrflix / OrbitControls.js
Last active November 29, 2021 02:44
Three.OrbitControls for multiple instances on a page.Usage: controls = new THREE.OrbitControls(camera, document, renderer.domElement); Based on: http://threejs.org/examples/js/controls/OrbitControls.js
/**
* @author qiao / https://github.com/qiao
* @author mrdoob / http://mrdoob.com
* @author alteredq / http://alteredqualia.com/
* @author WestLangley / http://github.com/WestLangley
* @author erich666 / http://erichaines.com
* @author mrflix / http://felixniklas.de
*
* released under MIT License (MIT)
*/