Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am edjw on github.
* I am edjw (https://keybase.io/edjw) on keybase.
* I have a public key whose fingerprint is 0C91 499B 9B98 42F3 CF0D 0275 214E 3950 A185 26B9
To claim this, I am signing this object:
@edjw
edjw / get_class_names.js
Last active December 13, 2018 16:55
Get the class names of a html element that you click on
"use strict";
document.addEventListener("click", function (event) {
event.preventDefault();
const allClasses = Array.from(event.target.classList).join(".");
const classes = "." + allClasses;
if (classes == ".") {
console.log("No classes found");
} else {
console.log(classes);
}
@edjw
edjw / specify_calendars_to_show_in_google_calendar.js
Created December 19, 2018 10:11
When you have lots of calendars in Google Calendar, it can be overwhelming and difficult to see only your events. Paste this script into the Console of your browser to toggle only seeing certain calendars. I might make a browser extension to do this
var calendars = Array.from(document.getElementsByClassName("NI2kfb qZvm2d-ibnC6b-bN97Pc DX3x9d"));
// ** RENAME THE CALENDARS IN THIS SECTION **
var calendarsToSee = ["NAME OF CALENDAR TO ALWAYS SEE 1", "NAME OF CALENDAR TO ALWAYS SEE 2"];
var calendarsToIgnore = ["Tasks", "Reminders"];
calendars.forEach(calendar => {
if (calendarsToSee.includes(calendar.innerText) == false && calendarsToIgnore.includes(calendar.innerText) == false) {
calendar.click();

Keybase proof

I hereby claim:

  • I am edjw on github.
  • I am edjw (https://keybase.io/edjw) on keybase.
  • I have a public key ASCEcDSvNHBwGCBBKerMcCFIhfVB60p0kNW4BGARDLA3EQo

To claim this, I am signing this object:

@edjw
edjw / wrapurls.regex
Last active May 28, 2019 13:50
Wrap bare urls in a:href or markdown link
HTML
Find: (http|ftp|https)://([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?
Replace: <a href="$0">$0</a>
Markdown
Find: ((http|ftp|https)://([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?)
Replace: [$1]($1)
@edjw
edjw / fb_ads_remove.js
Last active April 16, 2020 01:02
A script to remove you from advertisers' FB audience when they uploaded your contact information and it matched the information FB has about you
// This script removes you from advertisers' target lists on Facebook.
// They probably added you to their advert targeting list by uploading a contact list that includes
// your contact information like your email address or phone number.
// Comment below if this doesn't work for you
// *Instructions*
// 1. Go to https://www.facebook.com/ads/preferences
@edjw
edjw / refactoring-ui-box-shadow.css
Created April 24, 2020 10:43
box shadow from refactoring ui steve schoger
something {
box-shadow: 0 4px 6px 0 hsla(0, 0%, 0%, 0.2);
}
#page.with-headline #banner~#main #headline {
width: fit-content;
color: #000;
background: none;
}
#headline p {
background: none;
display: block !important;
margin-bottom: 0;
@edjw
edjw / ist-js-gist.js
Last active August 25, 2023 10:35
ist-js-gist
console.log("hello from a github gist");
const title = document.querySelector(`h1#page-title`);
// Function to get the current time in HH:MM:SS format
function getCurrentTime() {
const now = new Date();
const hours = String(now.getHours()).padStart(2, '0');
const minutes = String(now.getMinutes()).padStart(2, '0');
const seconds = String(now.getSeconds()).padStart(2, '0');
return `${hours}:${minutes}:${seconds}`;
@edjw
edjw / ist-css-gist.css
Last active August 25, 2023 10:36
ist-css-gist
body {
background-color: salmon;
}