Skip to content

Instantly share code, notes, and snippets.

@JAffleck
JAffleck / Adblock Simple.js
Created June 16, 2021 15:07 — forked from kbauer/Adblock Simple.js
A simple adblocker bookmarklet, removing suspicious iframes. To install, copy-paste the source to a bookmark (will automatically remove newline characters). Extend the array ``exceptOrigins`` in order to create new exceptions. Careful: If bookmarklets get too long, they might stop working. This methods provides on-demand adblocking (as opposed t…
javascript:/* Adblock Simple */
(function(){
const exceptOrigins = [
'https://disqus.com',
document.origin
];
function remIF(e){
try{
var orgn = new URL(e.src || 'http://unknown-src').origin;
(function() {
var CLASS = 'hide-images';
var STYLE = 'html body,html body *,html body *::before,html body *::after { background-image: none !important; } html body img, html body svg, html body video, html body iframe { opacity: 0.02 !important; }';
var block = document.querySelector('.' + CLASS);
// add/remove style block to override images
if (block) block.remove();
else {
block = document.createElement('style');
block.className = CLASS;
@JAffleck
JAffleck / iframe-killa
Created June 4, 2020 23:18 — forked from rodmcnew/iframe-killa.js
This is a bookmarklet that removes all iframes from the current page. Paste its code into a bookmark URL field. Click the bookmark to remove all iframes. Once started, it also removes newly spawned iframes every 100ms.
javascript:void(function(){setInterval(function(){document.querySelectorAll('iframe').forEach(function(element){console.log('Iframe Killa - Removing Element:', element);element.parentNode.removeChild(element)})},100)}());
@JAffleck
JAffleck / Selenium2Example1Test.java
Created July 26, 2017 21:53 — forked from neino3/Selenium2Example1Test.java
how to take screen shot by using Selenium2 Grid
import java.io.File;
import java.io.IOException;
import java.net.URL;
import org.apache.commons.io.FileUtils;
import org.junit.Assert;
import org.junit.Test;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.Platform;
@JAffleck
JAffleck / mvncolor.sh
Created June 3, 2016 18:45 — forked from katta/mvncolor.sh
Script to add colors to maven output
#!/usr/bin/env bash
# Formatting constants
export BOLD=`tput bold`
export UNDERLINE_ON=`tput smul`
export UNDERLINE_OFF=`tput rmul`
export TEXT_BLACK=`tput setaf 0`
export TEXT_RED=`tput setaf 1`
export TEXT_GREEN=`tput setaf 2`
export TEXT_YELLOW=`tput setaf 3`