Skip to content

Instantly share code, notes, and snippets.

View basscl's full-sized avatar

Eileen Mack basscl

  • Square Candy Design
View GitHub Profile
@cferdinandi
cferdinandi / stop-video.js
Last active October 8, 2024 13:22
A simple method to stop YouTube, Vimeo, and HTML5 videos from playing.
/**
* Stop an iframe or HTML5 <video> from playing
* @param {Element} element The element that contains the video
*/
var stopVideo = function ( element ) {
var iframe = element.querySelector( 'iframe');
var video = element.querySelector( 'video' );
if ( iframe ) {
var iframeSrc = iframe.src;
iframe.src = iframeSrc;
@lukechilds
lukechilds / get_latest_release.sh
Created August 9, 2016 19:43
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4
@hrbrmstr
hrbrmstr / robotstxt.csv
Created August 1, 2017 02:37
robots.txt user agent strings from June 2017 robots.txt Common Crawl
useragent n
* 494648
IRLbot 378368
bingbot 100948
MJ12bot 94377
msnbot 66142
AhrefsBot 51999
Yandex 50260
Slurp 49160
SemrushBot 45041