Skip to content

Instantly share code, notes, and snippets.

@azend
azend / youloop
Last active August 29, 2015 14:27 — forked from parkerlreed/Makefile
Script to monitor clipboard for a new Youtube URL and plays the video when the URL does not match the existing URL. Also does not run when an mpv instance is already running.
#!/bin/bash
function loop(){
sleep 2
url=`xclip -selection clipboard -o`
if [[ `cat /tmp/youtubeurl` == "$url" ]]
then
return
fi
mpv=`pgrep mpv`
if [[ $url == *"youtube"* && $mpv == "" ]]
<!-- A fairly normal copyright stamp with placeholder for current year -->
<p>&copy; Copywright <span class="copyrightYear"></span>, All rights reserved.</p>
<!-- Copywright date injection -->
<script type="text/javascript">
(function() {
function injectCopywrightDate() {
var year = new Date().getFullYear();
var placeholders = document.getElementsByClassName('copyrightYear');
/**
* azend's theory on medical naming schemes
*/
function nameMedicalCondition ( mainSymptom, severity ) {
var name = mainSymptom;
if ( is_int(severity) && severity > 5 + ( Math.floor( Math.rand() * 4 ) - 2 ) ) {
name += 'icul';
}