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
| var buttons; | |
| buttons = document.getElementsByClassName('_42ft'); | |
| for (var i = 0; i < buttons.length; i++) { | |
| if(buttons[i].getAttribute('ajaxify') != null){ | |
| if(buttons[i].getAttribute('ajaxify').indexOf('invite') != -1){ | |
| buttons[i].click(); | |
| } | |
| } | |
| } |
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
| These commands are based on a askubuntu answer http://askubuntu.com/a/581497 | |
| To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below. | |
| USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING. | |
| ABSOLUTELY NO WARRANTY. | |
| If you are still reading let's carry on with the code. | |
| sudo apt-get update && \ | |
| sudo apt-get install build-essential software-properties-common -y && \ | |
| sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \ |
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
| import praw | |
| from requests.exceptions import ConnectionError, HTTPError, Timeout | |
| def failable(f): | |
| def wrapped(*args, **kwargs): | |
| try: | |
| return f(*args, **kwargs) | |
| except praw.errors.APIException: | |
| full = traceback.format_exc() | |
| logging.warning("Reddit API call failed! %s" % full) |
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
| def compress(stringy): | |
| prvChr = "" | |
| newStr = "" | |
| matchCnt = 1 | |
| lenny = len(stringy) | |
| for i in range(lenny): | |
| # if not the last char in the string | |
| if i != lenny-1: | |
| # if current char equals next char |