Created
April 12, 2011 12:42
-
-
Save latentflip/915435 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Step1: install dotjs: https://github.com/defunkt/dotjs | |
//Step2: create files (default.js, procrastinate.js) | |
//Step3: symlink (see procrastinate.sh) | |
//Step4: stop faffing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ~/.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); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ~/.js/procrastinate.js | |
darkenDisplay(2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ln -s ~/.js/procrastinate.js ~/.js/ycombinator.com.js | |
ln -s ~/.js/procrastinate.js ~/.js/twitter.com.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
lol, nice one =)