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
@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);
}
@phocks
phocks / temperature-records-story.html
Last active January 24, 2018 03:38
Temperature records story
<p>Faark it’s hot, but it’s always been hot in summer right… everyone remembers burning bitumen under foot, restless hot nights,
has anything really changed?</p>
<p>The answer is YES! It’s getting hotter, if you don’t think it’s happening read this piece, and this piece, and this piece…
and this piece. And if you’ve read all of them and you’re still not convinced here a list of things that are less certain
than climate change that you’re probably not willing to take a risk on.</p>
<p>But before we go too far lets go back to those hot summer nights of your childhood… when were you born? (don’t worry we don’t
record this information).</p>

Keybase proof

I hereby claim:

  • I am phocks on github.
  • I am phocks (https://keybase.io/phocks) on keybase.
  • I have a public key ASBFb6NTMiooFKtg-PY2RobKw1SivWQpbCJtMX5IPxE1_Ao

To claim this, I am signing this object: