Skip to content

Instantly share code, notes, and snippets.

View hadidadkhah's full-sized avatar

hadi.dadkhah hadidadkhah

View GitHub Profile

Copy ChatGPT Transcript as markdown

javascript:void (async () => { let { default: TD } = await import("https://cdn.skypack.dev/turndown");  let json = [   ...document.querySelectorAll(".text-base"), ].map((i) => ({   html: i.innerHTML,   text: i.innerText,   markdown: new TD().turndown(i),   isPrompt: !i.querySelector(".prose"), }));  window.open(   URL.createObjectURL(     new Blob(       [         json           .map((i) =>             i.isPrompt ? `**Prompt**: ${i.text}` : `**ChatGPT**: ${i.markdown}`           )           .join("\n\n"),       ],       { type: "text/plain" }     )   ) ); })()

Google answer

Get a quick answer from google for any question

(async function answer(q) {
  var html = await fetch(
    `https://cors.explosionscratc.repl.co/google.com/search?q=${encodeURI(q)}`,
@Vinze
Vinze / calendar.php
Last active October 17, 2023 19:29
Create an HTML calendar with PHP and Carbon
<?php
// Make sure Carbon is available
function renderCalendar($dt) {
// Make sure to start at the beginnen of the month
$dt->startOfMonth();
// Set the headings (weeknumber + weekdays)
$headings = ['Weeknumber', 'Mondag', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saterday', 'Sunday'];