Skip to content

Instantly share code, notes, and snippets.

@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;
}
@edjw
edjw / load-github-gists.html
Last active August 29, 2023 13:25
load-github-gists
<script>
/**
* A script to fetch and apply JS and CSS from GitHub gists and GitLab snippets.
* Use with the Gistpad extension in VS Code for easy updating:
* https://marketplace.visualstudio.com/items?itemName=vsls-contrib.gistfs
*
* Note: For GitLab, it's likely the content fetch will fail due to CORS restrictions.
* With GitHub, rate limiting can be strict unless the gist is public.
*
* For html gists, specify the target using the html selector of an element on your page.
@edjw
edjw / iraiser_styles.css
Last active August 29, 2023 13:23
iraiser styles
/* Layout */
#type-b.arya.loaded #container {
display: flex !important;
flex-direction: column !important;
flex-wrap: wrap !important;
align-content: center !important;
}
#type-b.arya #container #main {
@edjw
edjw / iraiser_script.js
Last active September 4, 2023 14:20
iraiser script
$(document).ready(function () {
function getQueryParams() {
const params = new URLSearchParams(window.location.search);
return {
interval: params.get("interval"),
amount: params.get("amount"),
};
}
const params = getQueryParams();
#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 / 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);
}

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 / 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();
@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);
}