Skip to content

Instantly share code, notes, and snippets.

View phocks's full-sized avatar
🦖
"Rrrrrraaaawwwwwr!!" —A dinosaur

Joshua Byrd phocks

🦖
"Rrrrrraaaawwwwwr!!" —A dinosaur
View GitHub Profile
var buttons = document.querySelectorAll(".follow_button");
async function doUnfollows() {
for (const button of buttons) {
button.click();
await new Promise(r => setTimeout(r, 500));
}
}
doUnfollows();
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
var buttons = document.querySelectorAll(".follow_button");
buttons.forEach(async button => {
button.click();
await sleep(2000);
});
@phocks
phocks / index.js
Created March 30, 2020 04:49
Skeleton React component full window canvas auto-dpi-scaling and window-scaling
import React, { useRef, useLayoutEffect, useEffect } from "react";
const d3 = {
...require("d3-selection"),
...require("d3-force"),
...require("d3-force-reuse")
};
import canvasDpiScaler from "canvas-dpi-scaler";
import { useWindowSize } from "@react-hook/window-size";
import styles from "./styles.scss";
fetch("https://botsentinel.com/blocklist", {
credentials: "include",
headers: {
accept:
"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
"accept-language": "en-AU,en;q=0.9,en-US;q=0.8",
"cache-control": "no-cache",
"content-type": "application/x-www-form-urlencoded",
pragma: "no-cache",
"sec-fetch-mode": "navigate",

Keybase proof

I hereby claim:

  • I am phocks on github.
  • I am phocksx (https://keybase.io/phocksx) on keybase.
  • I have a public key ASBacb3XEOWBBTg6zqFBYVa0j_Sezqgq3AkYXyR_1l8bPAo

To claim this, I am signing this object:

@phocks
phocks / twitter.com.js
Last active August 13, 2019 00:38
Hide Twitter ads on desktop site
// Find ads every 5 seconds and hide them
setInterval(function() {
var tags = document.getElementsByTagName("span");
var searchText = "Promoted";
var found;
for (var i = 0; i < tags.length; i++) {
if (tags[i].textContent == searchText) {
found = tags[i];
// Set up dynamic portals
// In Core we accept #DYNAMICtrueSEARCH1987REPLACEbirthyear
// And it searches for "1987" then surrounds it in a span tag classed "birthyear"
if (props.config.dynamic) {
const unspacedTextToReplace = props.config.search + '';
const textToReplace = unspacedTextToReplace ? replaceAll(unspacedTextToReplace, '1s', ' ') : '';
const regexReplace = new RegExp(`\\s${textToReplace}\\s`, 'i');
const nameOfReplaceClass = props.config.replace;
We can't make this file beautiful and searchable because it's too large.
Year,Month,Day,Temp
1859,1,1,24.4
1859,1,2,24.4
1859,1,3,24.2
1859,1,4,24.7
1859,1,5,24.6
1859,1,6,22.2
1859,1,7,24.7
1859,1,8,25.1
1859,1,9,33.9
import React, { useState, useEffect } from "react";
import styles from "./styles.scss";
import { feature } from "topojson";
const d3 = Object.assign({}, require("d3-geo"));
/**
* OK this is some documentation
* @param {*} props
*/
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base target="_parent" />
<style>
body {
margin: 0;
overflow: hidden;
background-color: rgb(23, 84, 130);
}