Skip to content

Instantly share code, notes, and snippets.

View lafkpages's full-sized avatar

LuisAFK lafkpages

View GitHub Profile
@lafkpages
lafkpages / siggraph-2025-full-schedule-scraper.js
Last active August 12, 2025 19:03
Scrapes the Siggraph 2025 Full Schedule from https://s2025.conference-schedule.org and generates a CSV file with all of the sessions and their info. Note: the screen must be large enough so that the website renders all of the columns so they can be properly scraped.
(async({includeEnded:e,includeStartEndTimes:t})=>{let s=Date.now(),n=new(await import("https://esm.sh/turndown")).default,i=document.createElement("a");i.href=`data:text/csv;utf-8,${encodeURIComponent((await import("https://esm.sh/csv-stringify/browser/esm/sync")).stringify([...document.querySelectorAll("tbody tr.agenda-item")].filter(e=>e.checkVisibility()).map(e=>{let t=e.children[1].textContent,s=e.closest("[date]").getAttribute("date"),i=t+" "+s,r=new Date(s),a=t.match(/(\d\d?):(\d\d?)([ap]m)\s*-\s*(\d\d?):(\d\d?)([ap]m)\s+(PDT)/i),l=new Date(r),c=new Date(r);return l.setHours(parseInt(a[1])+7+("pm"===a[3]?12:0)),l.setMinutes(parseInt(a[2])),c.setHours(parseInt(a[4])+7+("pm"===a[6]?12:0)),c.setMinutes(parseInt(a[5])),[l,c,i].concat([...e.children].slice(2,7).map(e=>{let t=e.cloneNode(1);for(let s of(e.insertAdjacentElement("afterend",t),t.querySelectorAll("*")))s.checkVisibility()||s.remove();let i=n.turndown(t);return t.remove(),i}))}).filter(t=>e||t[1]>=s).map(e=>t?e:e.slice(2)),{header:!0,columns:(t?["
@lafkpages
lafkpages / sine.js
Created July 3, 2024 17:40
Modifies the global sine function to interpolate between randomly generated points.
const points = {};
const amplitude = 15;
// For polynomial interpolation
const interpolationLeft = 3;
const interpolationRight = 3;
// When true, uses polynomial interpolation
// Otherwise, uses linear interpolation