Skip to content

Instantly share code, notes, and snippets.

@latentflip
Created April 12, 2011 12:42
Show Gist options
  • Save latentflip/915435 to your computer and use it in GitHub Desktop.
Save latentflip/915435 to your computer and use it in GitHub Desktop.
//Step1: install dotjs: https://github.com/defunkt/dotjs
//Step2: create files (default.js, procrastinate.js)
//Step3: symlink (see procrastinate.sh)
//Step4: stop faffing
// ~/.js/default.js
//Fades webpages to black over time
function darkenDisplay(mins) {
var modal = $('<div></div>');
mins = mins || 2;
modal.css({
position: 'fixed',
top: 0,
left: 0,
width: '100%',
height: '100%',
backgroundColor: 'black',
zIndex: 100,
pointerEvents: 'none'
});
modal.hide();
$('body').append(modal);
modal.fadeIn(mins*60*1000);
}
// ~/.js/procrastinate.js
darkenDisplay(2);
ln -s ~/.js/procrastinate.js ~/.js/ycombinator.com.js
ln -s ~/.js/procrastinate.js ~/.js/twitter.com.js
@KidkArolis
Copy link

lol, nice one =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment