Skip to content

Instantly share code, notes, and snippets.

View dotspencer's full-sized avatar

Spencer Smith dotspencer

View GitHub Profile
@dotspencer
dotspencer / added-attributes.js
Last active November 24, 2020 18:31
Default attributes on window (chrome)
(() => {
const defaultKeys = {"window":true,"self":true,"document":true,"name":true,"location":true,"customElements":true,"history":true,"locationbar":true,"menubar":true,"personalbar":true,"scrollbars":true,"statusbar":true,"toolbar":true,"status":true,"closed":true,"frames":true,"length":true,"top":true,"opener":true,"parent":true,"frameElement":true,"navigator":true,"origin":true,"external":true,"screen":true,"innerWidth":true,"innerHeight":true,"scrollX":true,"pageXOffset":true,"scrollY":true,"pageYOffset":true,"visualViewport":true,"screenX":true,"screenY":true,"outerWidth":true,"outerHeight":true,"devicePixelRatio":true,"clientInformation":true,"screenLeft":true,"screenTop":true,"defaultStatus":true,"defaultstatus":true,"styleMedia":true,"onsearch":true,"isSecureContext":true,"performance":true,"onappinstalled":true,"onbeforeinstallprompt":true,"crypto":true,"indexedDB":true,"webkitStorageInfo":true,"sessionStorage":true,"localStorage":true,"onabort":true,"onblur":true,"oncancel":true,"oncanplay":true
@dotspencer
dotspencer / java-tips.md
Last active April 22, 2020 20:38
Java MacOS errors/tips

Error:

Gradle: Could not determine java version from '11.0.2'

List Java versions installed

@dotspencer
dotspencer / challenge.md
Last active March 6, 2020 20:27
Ghost in the Wire

Yjcv ku vjg pcog qh vjg uauvgo wugf da jco qrgtcvqtu vq ocmg htgg rjqpg ecnnu?

'Yjcv ku vjg pcog qh vjg uauvgo wugf da jco qrgtcvqtu vq ocmg htgg rjqpg ecnnu?'.toLowerCase().split('').map(a => {
  if (a === ' ') return a;
  if (a === '?') return a;
  charCode = a.charCodeAt(0) - 2;
  if (charCode < 97) charCode += 26;
  return String.fromCharCode(charCode);
}).join('');
@dotspencer
dotspencer / ctf-toolkit.md
Last active January 27, 2020 18:17
CTF Toolkit

For garbled data that you cant figure out

https://gchq.github.io/CyberChef/

⠛⠲⠵⠉⠁⠍⠚⠧⠛⠽⠟⠙⠉⠝⠚⠗⠑⠁⠽⠞⠊⠍⠵⠁⠛⠑⠆⠙⠅⠊⠃⠭⠛⠊⠟⠙⠊⠍⠃⠁⠛⠑⠒⠞⠉⠊⠃⠗⠛⠥⠒⠎⠁⠍⠚⠺⠛⠥⠟⠙⠊⠍⠃⠁⠛⠑⠆⠞⠊⠊⠃⠗⠛⠟⠆⠎⠁⠍⠚⠥⠛⠑⠟⠙⠉⠝⠗⠎⠑⠁⠽⠞⠅⠝⠗⠁⠛⠑⠆⠙⠅⠊⠃⠗⠛⠟⠆⠉⠁⠝⠃⠟⠑⠁⠽⠞⠍⠝⠃⠁⠛⠑⠆⠞⠁⠊⠃⠗⠛⠟⠆⠎⠁⠝⠃⠟⠑⠁⠽⠞⠊⠍⠗⠁⠛⠑⠆⠙⠉⠊⠃⠗⠛⠽⠵⠎⠁⠍⠚⠧⠛⠑⠟⠙⠉⠝⠃⠞⠑⠁⠽⠞⠍⠍⠵⠁⠛⠟⠽⠉⠁⠍⠚⠧⠛⠲⠟⠙⠉⠝⠃⠺⠑⠁⠆⠙⠁⠊⠃⠗⠛⠁⠵⠎⠁⠍⠚⠭⠛⠑⠟⠙⠉⠝⠃⠎⠑⠁⠽⠞⠊⠝⠚⠁⠛⠑⠒⠙⠑⠊⠃⠗⠛⠁⠵⠎⠁⠍⠚⠧⠛⠁⠟⠙⠉⠝⠃⠧⠑⠁⠽⠞⠊⠝⠗⠁⠛⠟⠽⠟⠿⠿⠿⠿

Use ingredients: from braile and magic

@dotspencer
dotspencer / atob-btoa.md
Created January 17, 2020 20:35
Node atob and btoa
const atob = b64 => Buffer.from(b64, 'base64').toString('binary');
const btoa = text => Buffer.from(text, 'binary').toString('base64');
@dotspencer
dotspencer / crazy.md
Last active January 17, 2022 18:35
VSCode Drives Me Crazy...

Reasons

  1. Tabbing from beginning of line doesn't jump to correct indentation. Only indents one level.
  2. Tab filename can't be hilighted to match source control state (yellow for modified files, green for new, etc.)
  3. The default icons are so distracting and folder names are hard to see. (can be configured but still...)
  4. Dragging tabs around is so annoying. Can't pick which side of a tab you want to move it to.
  5. The UI is so cluttered...
@dotspencer
dotspencer / simple-maze-graph.js
Created September 26, 2019 18:18
Simple Maze Graph Generator
(() => {
const dim = 7;
const graph = {};
const path = [];
// create graph
for (let i = 0; i < dim*dim; i++) {
const row = i % dim;
const col = Math.floor(i / dim);
const edges = [
@dotspencer
dotspencer / stop-https.md
Last active June 18, 2019 02:47
Stop HTTP to HTTPS cached redirect in Chrome

Go to chrome://net-internals/#hsts and type the domain (example.com) into the "Query HSTS/PKP domain" to view it.

If it shows up, type the same domain into the "Delete domain security policies" input and click Delete

@dotspencer
dotspencer / docker.md
Last active June 15, 2019 07:35
Useful docker commands
docker images

docker container ls

docker container ls -a

docker system prune

docker build -t registry.gitlab.com// .
@dotspencer
dotspencer / review-times.csv
Last active June 1, 2019 02:46
Chrome extension review times
Extension Version Start End
Link Match Highlighter 0.1 5/22/19 5/28/19
Link Match Highlighter 0.2 5/28/19 5/31/19