Created
November 11, 2012 23:41
-
-
Save Radagaisus/4056748 to your computer and use it in GitHub Desktop.
like
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
| reverse = (fn, args...) -> | |
| fn.apply(this, args.slice(0).reverse()) | |
| times = (step, times, fn, args...) -> | |
| checks = 0 | |
| interval = reverse setInterval, 1500, -> | |
| if fn.apply(this, args) or checks++ >= times | |
| clearInterval(interval) | |
| detect_facebook_like = -> | |
| return false unless FB? | |
| # edge.create is a like | |
| FB.Event.subscribe 'edge.create', (e, fb) -> | |
| # Hide Ads! | |
| FB.Event.subscribe 'edge.remove', (e, fb) -> | |
| # Show Ads again! | |
| return true | |
| $ -> | |
| times 1500, 20, detect_facebook_like |
LeonFedotov
commented
Nov 11, 2012
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment