Skip to content

Instantly share code, notes, and snippets.

View eviltester's full-sized avatar

Alan Richardson eviltester

View GitHub Profile
var xhttp = new XMLHttpRequest();
xhttp.open("GET","https://bitbloxs.herokuapp.com/boxes?api_key=thisistheapikey");
xhttp.onload = (e)=>{
console.log(xhttp.status);
console.log(xhttp.responseText);
}
xhttp.send(null);
@eviltester
eviltester / gist:11093f0e4c501a41990e227393184eda
Last active April 24, 2024 11:35
uncheck twitter interests
var timer=100;document.querySelectorAll("div > input[type='checkbox']:checked").forEach((interest) => {setTimeout(function(){interest.click()},timer);timer+=2000;});
@eviltester
eviltester / _sample.java
Created November 11, 2019 11:43
deprecated example using a firefox plugin
@Test
public void firefoxUseExtensions() throws IOException {
// **************************************************************************
// profile is good for setting preferences and fiddling with browser settings
// **************************************************************************
// Download the extension to a local folder
String s = File.separator;
String extensionPath = System.getProperty("user.dir") +
@eviltester
eviltester / PortableFirefoxDriverTest.java
Created November 11, 2019 10:59
deprecated portable firefox
package com.seleniumsimplified.webdriver.drivers;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxBinary;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxOptions;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.remote.DesiredCapabilities;
@eviltester
eviltester / FirefoxMarionetteDriverTest.java
Created November 11, 2019 10:57
deprecating marionnette test code
package com.seleniumsimplified.webdriver.drivers;
import com.seleniumsimplified.webdriver.manager.Driver;
import com.seleniumsimplified.webdriver.manager.ProxyPort;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
//import org.openqa.selenium.firefox.MarionetteDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
@eviltester
eviltester / linkchecker.js
Last active January 15, 2024 04:48
link checking from snippets
var links = document.querySelectorAll("a");
var linkReport = [];
var linksChecked=0;
links.forEach(function(link){
var reportLine = {url: link.getAttribute('href'), status:0, redirectedTo: "", message : "", element : link};
linkReport.push(reportLine);
console.log("HEAD " + reportLine.url);
@eviltester
eviltester / gist:7262f4d0e8226cd2fa57d750e3faff95
Created June 26, 2019 10:56
simple galaxian game hacks
Found this little Galaxians game which is quite nice and hackable:
http://michal.biniek.pl/games/galaxian.html
~~~~~~~~
var infiniteLivesBot = setInterval(function(){if(oLives.iLives<3){oLives.add();}},1000);
~~~~~~~~
~~~~~~~~
var autofireBot = setInterval(function(){MyShip.shoot();},200)
@eviltester
eviltester / gist:dd242b5fed697cf3fe91a86a25fd5ab9
Last active December 6, 2018 15:04
How long is a course on zenler?
var times = document.getElementsByClassName("curr-time");
var totaltime= 0;
for (var i = 0, len = times.length; i < len; i++) {
time = document.getElementsByClassName("curr-time")[i].innerText.trim();
if(time.length>0){
var b = time.split(':');
console.log(b);
seconds = (Number(b[0])*60) + (Number(b[1]));
totaltime+=seconds;
}
var scrollyText="Li4uLi4uLi4uLi4uLi4uLi4uLi4uLiNUaGFua1lvdVBhdHJvbnMuLi4uLi4uLi4uLi4uLi4uLiBZZXMgaXQgaXMgTm92ZW1iZXIgMTl0aCAyMDE4IGFuZCB0aGF0IG1lYW5zIGl0IGlzLi4uICdUaGFuayBZb3UgUGF0cm9ucyBkYXknLiBBbmQgSSBkbyB3YW50IHRvIHRoYW5rIHlvdSBmb3IgYWxsIHlvdXIgc3VwcG9ydCBhbmQgcXVlc3Rpb25zLiBZb3UncmUgaGVscGluZyBtZSBleHBsb3JlIGFuZCB0aGluayBkaWZmZXJlbnRseSBhYm91dCBTb2Z0d2FyZSBUZXN0aW5nIGFuZCBEZXZlbG9wbWVudCBldmVyeSBkYXkuIE1hbnkgVGhhbmtzLCBBbGFuLi4uLg==";
function scrolly(len, locator){
var t = atob(scrollyText);
document.querySelector(locator).innerText=t.substring(0,len);
t = t.substring(1)+t.substring(0,1);
scrollyText = btoa(t);
}
var scrollyBot = setInterval(function(){scrolly(50,"span[data-tag='post-title']")},150);
@eviltester
eviltester / gist:0b5c1289263d31cd5305fb70985c2d8f
Created October 17, 2018 12:01
code for old Udemy blog post
import org.junit.Assert;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import java.util.concurrent.TimeUnit;