Skip to content

Instantly share code, notes, and snippets.

View CrystalDave's full-sized avatar

David Ross CrystalDave

View GitHub Profile
@agnoster
agnoster / README.md
Last active July 13, 2024 19:26
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@timsneath
timsneath / profile.ps1
Last active June 17, 2024 11:08
PowerShell template profile: adds some useful aliases and functions
### PowerShell template profile
### Version 1.03 - Tim Sneath <tim@sneath.org>
### From https://gist.github.com/timsneath/19867b12eee7fd5af2ba
###
### This file should be stored in $PROFILE.CurrentUserAllHosts
### If $PROFILE.CurrentUserAllHosts doesn't exist, you can make one with the following:
### PS> New-Item $PROFILE.CurrentUserAllHosts -ItemType File -Force
### This will create the file and the containing subdirectory if it doesn't already
###
### As a reminder, to enable unsigned script execution of local scripts on client Windows,
@paulirish
paulirish / what-forces-layout.md
Last active July 25, 2024 07:49
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@anderskig
anderskig / Repo
Created May 18, 2018 07:25 — forked from aridastidar/Repo
Open a project file on GitHub.
#!/bin/bash
#
# Open the specified file on GitHub. It will use the current branch by default:
#
# repo app/controllers/application_controller.rb
#
# Specify a different branch:
#
# repo -b another-branch app/controllers/application_controller.rb
@bluetidepro
bluetidepro / remove-advertisers.js
Last active December 29, 2023 06:27
Auto click "remove" on all facebook advertisers and Twitter interests
// I did this in Chrome...
//
// Go to https://www.facebook.com/ads/preferences/
// Click the "Advertisers" section to open it up.
// Click "See more" once
// Before doing anything else, just keep clicking space bar to trigger the "see more" button
// Do this for a bit until all the advertisers are loaded
// then run this below in the dev tools console...
// (It will take a few minutes, depending how many you have, and your browser may lock up, but once it's done you will see it auto clicked the "remove" X in the top right for all of them)
@Neo23x0
Neo23x0 / Base64_CheatSheet.md
Last active July 5, 2024 17:29
Learning Aid - Top Base64 Encodings Table

Base64 Patterns - Learning Aid

Base64 Code Mnemonic Aid Decoded* Description
JAB 🗣 Jabber $. Variable declaration (UTF-16), e.g. JABlAG4AdgA for $env:
TVq 📺 Television MZ MZ header
SUVY 🚙 SUV IEX PowerShell Invoke Expression
SQBFAF 🐣 Squab favorite I.E. PowerShell Invoke Expression (UTF-16)
SQBuAH 🐣 Squab uahhh I.n. PowerShell Invoke string (UTF-16) e.g. Invoke-Mimikatz
PAA 💪 "Pah!" &lt;. Often used by Emotet (UTF-16)
@tkadlec
tkadlec / perf-diagnostics.css
Last active June 8, 2023 17:47
CSS used to highlight potential performance issues
:root {
--violation-color: red; /* used for clear issues */
--warning-color: orange; /* used for potential issues we should look into */
}
/* IMAGES */
/*
* Lazy-Loaded Images Check
* ====
@andydavies
andydavies / cleanPage.js
Created February 9, 2021 15:23
DevTools snippet to remove the document contents and any event handlers on document and window objects
document.documentElement.innerHTML = '';
for (const obj of [document, window]) {
for (const event of Object.values(getEventListeners(obj))) {
for (const {type, listener, useCapture} of event) {
obj.removeEventListener(type, listener, useCapture)
}
}
}
@HenryHey
HenryHey / blaseballAutobet.js
Last active May 11, 2021 04:40
Blaseball auto bet to the team with the best (probably not) chance of winning
// This bookmarklet will auto bet on the team with highest odds. Or the left team if equal odds.
// I guess this saves around 20 seconds and 30 clicks of your life. You're welcome!
// 1. Create a new bookmark and give it a name
// 2. Paste the following code in the URL field
javascript:(async function () { let goBet=async e=>{length=document.getElementsByClassName("Widget-Button btn btn-success").length;for(let t=0;t<length;t++)try{document.getElementsByClassName("Widget-Button btn btn-success")[t].children[0].click(),await new Promise(t=>setTimeout(t,e)),[...document.getElementsByClassName("ModalForm-Form-Team-Percentage")].filter(e=>parseFloat(e.innerHTML)>=50)[0].click(),document.getElementsByClassName("ModalForm-Form-Inputs-Amount-Max")[0].click(),document.getElementsByClassName("ModalForm-Submit btn btn-success")[0].click(),await new Promise(t=>setTimeout(t,2*e))}catch(t){await new Promise(t=>setTimeout(t,2*e)),await goBet(500)}return"Done!"};await goBet(500); } )();
// 3. Go to https://www.blase