Skip to content

Instantly share code, notes, and snippets.

@TimothyBramlett
TimothyBramlett / calculator-bench-press-calories-burned.markdown
Created February 18, 2023 15:32
Calculator - Bench Press Calories Burned
@TimothyBramlett
TimothyBramlett / facebook-page-invite.js
Created September 23, 2019 05:44 — forked from guiliredu/facebook-page-invite.js
Facebook - Script to auto invite people who liked a page post do like the page
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();
}
}
}
@TimothyBramlett
TimothyBramlett / how-to-install-latest-gcc-on-ubuntu-lts.txt
Created September 26, 2017 04:40 — forked from sha8e/how-to-install-latest-gcc-on-ubuntu-lts.txt
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
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 && \
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)
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