Skip to content

Instantly share code, notes, and snippets.

@camjocotem
camjocotem / buyBackPets.js
Created May 9, 2018 21:39
Tagged.com - Automate buying back pets
//Just paste this into the devtools console to make it work then run the commented out code at bottom
function getNumber(text) {
return parseInt(text.replace(/^\D+/g, '').replace(/[a-zA-Z]/g, '').replace(/\s/g, '').replace(/\,/g, ''));
}
function buyPetIfLower(petItr) {
var myMoney = getNumber(document.getElementsByClassName('id-label-cash')[0].firstChild.firstChild.title);
var petCollection = document.getElementsByClassName('pet-list-row');
@camjocotem
camjocotem / buyNewPets.js
Created May 9, 2018 21:41
Tagged.com - Automate buying new pets
function getNumber(text) {
return parseInt(text.replace(/^\D+/g, '').replace(/[a-zA-Z]/g, '').replace(/\s/g, '').replace(/\,/g, ''));
}
function buyPetIfLower(petItr) {
var myMoney = getNumber(document.getElementsByClassName('id-label-cash')[0].firstChild.firstChild.title);
var petCollection = document.getElementById('browse_list').children;
if (!petCollection[petItr]) {
return;
@camjocotem
camjocotem / MathHelper.vb
Last active April 11, 2019 13:53
Radians/Degrees Helper in VB
Public Class MathHelper
Public Shared Function ToDegrees(ByVal radians As Double) As Double
Return radians * (180 / Math.PI)
End Function
Public Shared Function ToRadians(ByVal degrees As Double) As Double
Return degrees / (180 / Math.PI)
End Function
Public Shared Function ToDegrees(ByVal radians As Decimal) As Decimal
javascript:if(!('remove'in Element.prototype)){Element.prototype.remove=function(){if(this.parentNode){this.parentNode.removeChild(this)}}}function showDiscounts(){minDiscount=10;function getProducts(){return[].slice.call(document.getElementsByTagName('*')).filter(function(e){if(e.getAttribute("data-asin")!==null&&e.className!=="asinImage"){return true}return false})}function productHasDiscount(product){if(product.getAttribute("data-a-strike")!==null){return true}else if(product.children&&product.children.length){var prodHasDisc=false;[].slice.call(product.children).forEach(function(c){var discExists=productHasDiscount(c);if(discExists){prodHasDisc=true}});return prodHasDisc}return false}function showDiscount(){var discElements=[].slice.call(document.getElementsByTagName('*')).map(function(e){if(e.getAttribute("data-a-strike")!==null){return e.parentElement}return null}).filter(function(d){return d!==null});discElements.forEach(function(e){calcDiscount(e)});reorderItems(getProducts());function calcDiscount(pa
@camjocotem
camjocotem / amazon_discounts_v2.js
Last active July 13, 2021 15:30
amazon_discounts_v2.js
if (!('remove' in Element.prototype)) {
Element.prototype.remove = function () {
if (this.parentNode) {
this.parentNode.removeChild(this)
}
}
};
function showDiscounts() {
var minDiscount = 100;
@camjocotem
camjocotem / fb-antisocial.js
Created May 30, 2019 19:41
Get rid of all Facebook friend suggestions (shouldn't be filter but meh whatever)
[].slice.call(document.getElementsByTagName('*')).filter((e)=>{
if(e.getAttribute("data-tooltip-content") === "Remove"){
e.click();
}
});
@camjocotem
camjocotem / FBShowText.js
Last active June 15, 2021 10:53
FB_AltText
javascript: if (!document.getElementById("thatAltTextThar")) {
var image = document.getElementsByClassName("spotlight")[0];
if (image) {
var altText = image.getAttribute("alt");
if (altText) {
var styleElement = document.createElement("span");
styleElement.setAttribute("style", "font-size: 2rem; position: absolute; color: white; left: 0; bottom: 0; line-height: 2rem; background: black; padding: .5rem;"),;
styleElement.innerText = altText;
styleElement.id = "thatAltTextThar";
image.parentElement.appendChild(styleElement);
@camjocotem
camjocotem / fb_unfollow.js
Created July 5, 2019 12:18
fb_unfollow.js
function unfollow() {
[].slice.call(document.getElementsByTagName('*')).filter((el) => {
return el.getAttribute('aria-label') === "Story options"
}).forEach((el) => {
el.click();
});
[].slice.call(document.getElementsByTagName('*')).filter((el) => {
if (el.getAttribute("title")) {
return el.getAttribute("title").match(/Unfollow.+/g)
@camjocotem
camjocotem / layerGen.js
Last active June 15, 2021 10:53
Photoshop Shader generation
var app = new Application();
var { hue, saturation, light } = rgbToHsl(app.foregroundColor.rgb.red, app.foregroundColor.rgb.green, app.foregroundColor.rgb.blue)
var stepsToTake = prompt("How many steps should be generated?", 2);
var tempBased = prompt("'y' For do temperature based shading, 'n' for light based shading", 'y');
var stepAmount = prompt("What increment should each step take?", 20)
/**
@camjocotem
camjocotem / shader-gen.js
Created September 14, 2019 19:06
Generate shading based on current selected colour
(
/**
* @param {Application} app
*/
function (app) {
var HUE_MAX = 359;
var RGB_MAX = 255;
var HSV_MAX = 100;
var jps = new JPS();
if (BridgeTalk.appName !== "photoshop") {