Skip to content

Instantly share code, notes, and snippets.

@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`
@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 / Hub.json
Last active December 14, 2018 17:17
Running Webdriver tests in VirtualBox VM in Microsoft Edge in Selenium Grid 3
{
"port": 4444,
"newSessionWaitTimeout": -1,
"servlets" : [],
"withoutServlets": [],
"custom": {},
"capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher",
"throwOnCapabilityNotPresent": true,
"cleanUpCycle": 5000,
"role": "hub",
@JAffleck
JAffleck / editWithNeoVIm.reg
Created June 17, 2018 05:42
Neovim - Edit With Neovim WIndows Context menu
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\Neovim]
@="Edit with Neovim"
"Icon"="C:\\tools\\neovim\\Neovim\\bin\\nvim-qt.exe"
[HKEY_CLASSES_ROOT\*\shell\Neovim\command]
@="\"C:\\tools\\neovim\\Neovim\\bin\\nvim-qt.exe\" \"%1\""
@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 / gist:48b7c776a01ad5bc30cb11749f725da1
Created June 4, 2020 23:21
Bookmarklet - Remove page elements
`javascript:javascript:(function(){var d=document,i=0,l,em=0,ed,b=d.body,w=window,sl=[],hid=[],$=b.getElementsByTagName('*'),cTp=(d.all&&!w.opera)?'absolute':'fixed',css=d.createElement('style');css.type='text/css';css.media='all';var cT='#mPp{font-size:15px;padding:5px;background:#fdd;color:#000;position:'+cTp+';top:0;right:0;zIndex:1000;text-align:right}#mPp:hover{padding:.5em;line-height:1.6;}#mPp:hover u{display:none}#mPp i{display:none;text-align:left;cursor:default;color:#000}#mPp:hover i{display:block}#mPp b{border:1px outset #000;background:#fff;color:#666;padding:0 2px;margin-right:4px}#mPe{position:absolute;left:0;right:0;padding:5px 10px;background:#fdd;text-align:left}#mPe textarea{width:99%;display:block}'+'.mPs,.mPs *{background:#ff0;color:#000;}.mPh{background:#ffc;}.mPi,.mPi *{background:#fff;width:auto;float:none;margin:1em 0;padding:0;}body.mPi{text-align:left;margin:0;}'.replace(/;/g,' !important;');if(css.styleSheet)css.styleSheet.cssText=cT;else css.appendChild(d.createTextNode(cT));d.get
@JAffleck
JAffleck / select.bat
Created August 28, 2020 19:03
Open explorer, select file from batch file
@echo off
set filename=%1
set "strToMeasure=%CD%"
call :strLen strToMeasure strlen
@REM echo.String is %strlen% characters long
call :filePath %strlen% %filename%
exit /b
@REM methods stolen to get string length
(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;
/*
MyPage bookmarklet
Copyright 2006 Steve Clay
License: http://mrclay.org/licenses/bsd.html
*/
// this lets you remove individual elements (I only use R, and esc)
/*
Perform actions via keyboard (mouse over [?] in the top right corner)
R Remove selected element(s)
U Undo removal
@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;