Skip to content

Instantly share code, notes, and snippets.

View TechWithTy's full-sized avatar
🎯
Focusing

TechWIthTy TechWithTy

🎯
Focusing
View GitHub Profile
@jadeallencook
jadeallencook / flatten.js
Created May 22, 2019 01:08
Recursive ES6 function that flattens an array.
const flatten = array => array.reduce((temp, value) => temp.concat(Array.isArray(value) ? flatten(value) : value), []);
// example
console.log(flatten([[['str']],undefined,null,{},[[true,false],[{},[]],[],{}],[],[],[],[]]));
@jadeallencook
jadeallencook / instalike.js
Last active March 15, 2024 01:15
instagram autolike script
let likes = 0;
setInterval(() => {
const heart = document.querySelector('svg[aria-label="Like"][width="24"]');
const arrow = document.querySelector('svg[aria-label="Next"]');
if (heart) {
heart.parentNode.parentElement.click()
likes++;
console.log(`You've liked ${likes} post(s)`);
}
arrow.parentElement.parentElement.click();
@gidili
gidili / profanity_check.js
Created January 31, 2013 16:46
simple javascript profanity check
// extend strings with the method "contains"
String.prototype.contains = function(str) { return this.indexOf(str) != -1; };
// profanities of choice
var profanities = new Array("ass", "cunt", "pope");
var containsProfanity = function(text){
var returnVal = false;
for (var i = 0; i < profanities.length; i++) {
if(text.toLowerCase().contains(profanities[i].toLowerCase())){