Skip to content

Instantly share code, notes, and snippets.

View AndersDJohnson's full-sized avatar

Anders D. Johnson AndersDJohnson

View GitHub Profile
{
const $ = document.querySelector.bind(document)
do {
$('[data-qa="remove-favorite"]').click()
await new Promise(r => setTimeout(r, 1000))
$('[data-qa="yes-remove-btn"]').click()
await new Promise(r => setTimeout(r, 1000))
next = $('[data-qa="remove-favorite"]')
} while (next)
}
{
const $ = document.querySelector.bind(document)
do {
$('.remove-ad').click()
await new Promise(r => setTimeout(r, 1000))
$('.btn--wide').click()
await new Promise(r => setTimeout(r, 3000))
next = $('.remove-ad')
} while (next)
}
@AndersDJohnson
AndersDJohnson / fzf-history-exec.sh
Last active June 5, 2019 13:36
Execute a command from history picked with fuzzy finder.
`history | fzf | tr -s ' ' | cut -d' ' -f 3-`

Keybase proof

I hereby claim:

  • I am andersdjohnson on github.
  • I am andersdjohnson (https://keybase.io/andersdjohnson) on keybase.
  • I have a public key ASBoMNJKbZ96SGvQXpSqFIq-41CVixOc-1JBgignRZ3BHwo

To claim this, I am signing this object:

@media (min-width: @screen-xs-min) {
.hidden-xs-min-up {
display: none !important;
}
}
@screen-xs-min-max: @screen-xs-min - 1;
@media (max-width: @screen-xs-min-max) {
.hidden-xs-min-down {
display: none !important;
}
@AndersDJohnson
AndersDJohnson / extend-events-view.js
Last active June 5, 2019 13:36
Backbone extend events view
/**
* http://danhough.com/blog/backbone-view-inheritance/
* @param child
* @return {*}
*/
ExtendEventsView.extend = function (child) {
var view = Backbone.View.extend.apply(this, arguments);
var protoEvents = this.prototype.events;
if (_.isFunction(protoEvents)) {
protoEvents = protoEvents();
javascript:!function(){var n,e,r,i;n=window,e=document.body,r=JSON.parse,i=JSON.stringify,n.isf||(e.innerHTML="<pre>"+i(r(e.innerText),null,4).replace(/\"([^\:]*?)\:/g,'<span style="color:#9C3636">"$1&colon;</span>')+"</pre>",n.isf=!0)}();
//usage:
//save as bookmark and click it whenever you open a json response in a browser tab/window
@AndersDJohnson
AndersDJohnson / starcounter.js
Last active June 5, 2019 13:32 — forked from yyx990803/starcounter.js
Count your total stars!
var https = require('https'),
user = process.argv[2],
opts = parseOpts(process.argv.slice(3))
request('/users/' + user, function (res) {
if (!res.public_repos) {
console.log(res.message)
return
}
var pages = Math.ceil(res.public_repos / 100),
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* From http://rosettacode.org/wiki/Brace_expansion#Java
*
* May integrate with https://github.com/AndersDJohnson/brace-expansion-java.
*/
@AndersDJohnson
AndersDJohnson / pom.xml
Last active June 5, 2019 13:37
Maven Copy Dependencies
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>...</groupId>
<artifactId>...</artifactId>
<version>...</version>
<!--<packaging>war</packaging>-->