Skip to content

Instantly share code, notes, and snippets.

View thevolcanomanishere's full-sized avatar
🍑

Alex McGonagle thevolcanomanishere

🍑
View GitHub Profile
@thevolcanomanishere
thevolcanomanishere / bookmarklet.js
Created January 23, 2025 15:32
Qualtrics Dev Mode bookmarklet
javascript:(()=>{let e,t="",n;function i(e,t,n=!1){let i=document.createElement("div");i.style.marginBottom="10px",i.style.border="1px solid #ddd",i.style.borderRadius="4px";let o=document.createElement("div");o.style.padding="10px",o.style.backgroundColor="#f5f5f5",o.style.cursor="pointer",o.style.userSelect="none",o.innerHTML=`<span style="margin-right: 5px">${n?"▼":"▶"}</span>${e}`;let l=document.createElement("div");return l.style.padding="10px",l.style.display=n?"block":"none",l.appendChild(t),o.onclick=()=>{let e="block"===l.style.display;l.style.display=e?"none":"block",o.firstChild.textContent=e?"▶":"▼"},i.appendChild(o),i.appendChild(l),i}function o(e){let t=document.createElement("div"),n=document.createElement("div");n.innerHTML=`
<div style="margin-bottom: 5px"><strong>Question ID:</strong> ${e.QuestionID}</div>
<div style="margin-bottom: 5px"><strong>Type:</strong> ${e.QuestionType}</div>
<div style="margin-bottom: 5px"><strong>Selector:</strong> ${e.Selector}</div>
`,t.appendChild(i(
@thevolcanomanishere
thevolcanomanishere / deploy-cloudflare-pages.yml
Last active July 15, 2024 12:56
Deploy to Cloudflare Pages example Github Action
name: Deploy React Static to Cloudflare Pages
on:
push:
branches: ["main"]
paths:
- "path/to/project/**"
pull_request:
branches: ["main"]
paths:
@thevolcanomanishere
thevolcanomanishere / ExampleComponent.tsx
Last active August 2, 2022 07:11
Toggling darkmode the easy way (Tailwind)
const ExampleComponent = () => {
return <h1 className="bg-white dark:bg-black">Hello</h1>;
};
export default ExampleComponent;
@thevolcanomanishere
thevolcanomanishere / DetectBreakpoint.tsx
Created July 28, 2022 11:20
Detecting Tailwind breakpoints in Typescript
const DetectBreakpoint = () => {
const getCurrentBreakpoint = (): string => {
const breakpointUnknown: string = "unknown";
const breakpointSM: string | null =
document.getElementById("breakpoint-sm")?.offsetParent === null
? null
: "sm";
const breakpointMD: string | null =
document.getElementById("breakpoint-md")?.offsetParent === null
? null