יום שני, 30 ביוני 2025

תפריט שאלות של השיחה הנוכחית ChatGPT

תפריט פרומפטים ל-chatGPT


כתבתי תוסף לכרום שמוסיף את התפריט באופן אוטומטי (עם אפשרות למזעור או סגירה)
ניתן להוריד את התוסף מחנות גוגל כרום

אם לא ניתן להתקין תוספים אצלך בדפדן, אז אפשר להפעיל את זה בדרך הבאה:

  1. לחץ כאן כדי להעתיק את הקוד
  2. לחץ ctrl+d כדי ליצור סימניה
  3. שנה את שם הסימניה ל-תפריט, ובמקום כתובת, הדבק את הטקסט שהעתקת בסעיף 1
  4. בזמן שימוש באתר ChatGPT, לחץ על הסימניה ששמרת כדי להציג את התפריט

javascript:(()=>{const e=document.createElement("style");e.textContent="#floatingMenu{position:fixed;top:100px;right:10px;width:270px;max-height:400px;background:rgba(0,0,0,.6);color:#fff;font-family:Arial,sans-serif;font-size:14px;border-radius:6px;box-shadow:0 0 10px black;display:flex;flex-direction:column;user-select:none;z-index:999999;overflow:hidden;transition:max-height .4s ease}#floatingMenu.collapsed{max-height:40px}#floatingMenuHeader{padding:8px 10px;background:rgba(0,0,0,.8);cursor:move;display:flex;justify-content:space-between;align-items:center;font-weight:700}#floatingMenuTitle{flex-grow:1;text-align:center}#floatingMenuControls{display:flex;align-items:center}#floatingMenuControls>button{cursor:pointer;margin-left:10px;font-weight:700;background:none;border:none;color:#fff;font-size:16px;line-height:1;padding:0;display:flex;align-items:center;justify-content:center}#floatingMenuControls>button:focus{outline:2px solid #fff;outline-offset:2px}#searchInput{margin:0 10px;padding:5px 8px;border-radius:4px;border:none;font-size:14px;width:calc(100% - 20px);box-sizing:border-box;max-height:0;opacity:0;pointer-events:none;transition:max-height .4s ease,opacity .4s ease,margin .4s ease;direction:rtl}#searchInput.visible{max-height:40px;opacity:1;pointer-events:auto;margin:5px 10px}#floatingMenuList{padding:5px 10px;transition:opacity .3s ease;flex-grow:1;display:flex;flex-direction:column;overflow:hidden}#floatingMenuList.scrollable{overflow-y:auto;max-height:340px}#floatingMenuList div{padding:5px 8px;border-radius:4px;margin-bottom:4px;background:rgba(255,255,255,.1);cursor:pointer;white-space:nowrap;text-overflow:ellipsis}#floatingMenuList div:hover,#floatingMenuList div:focus{background:rgba(255,255,255,.25);outline:none}#floatingMenu.collapsed #searchInput,#floatingMenu.collapsed #floatingMenuList{opacity:0;pointer-events:none;height:0;padding:0 10px;overflow:hidden!important;transition:opacity .4s ease,height .4s ease,padding .4s ease,margin .4s ease}",document.head.appendChild(e);const t=document.createElement("div");t.id="floatingMenu",t.setAttribute("role","region"),t.setAttribute("aria-label","תפריט שאלות");const n=document.createElement("div");n.id="floatingMenuHeader",n.setAttribute("role","banner");const o=document.createElement("div");o.id="floatingMenuTitle",o.textContent="ריק";const i=document.createElement("div");i.id="floatingMenuControls";const l=document.createElement("button");l.id="toggleSearchBtn",l.textContent="?";const a=document.createElement("button");a.id="collapseBtn",a.textContent="-";const c=document.createElement("button");c.id="closeBtn",c.textContent="×",i.appendChild(l),i.appendChild(a),i.appendChild(c),n.appendChild(o),n.appendChild(i);const s=document.createElement("input");s.id="searchInput",s.type="search",s.placeholder="חפש שאלות...";const d=document.createElement("div");d.id="floatingMenuList",t.appendChild(n),t.appendChild(s),t.appendChild(d),document.body.appendChild(t);function p(e){return/[\u0590-\u05FF]/.test(e)}function u(e,t){for(;e;){if(e.classList&&e.classList.contains(t))return!0;e=e.parentElement}return!1}function f(){const e=document.querySelectorAll(".whitespace-pre-wrap"),t=[];return e.forEach(((e,n)=>{let o=27;if(u(e,"text-page-header"))return;let i=e.textContent.trim().replace(/\s+/g," ");i.length>o&&(i=i.slice(0,o)+"…"),t.push({el:e,text:i,index:n,fullText:e.textContent.trim()})})),t}let r=null;function m(){const e=f(),n=JSON.stringify(e.map((e=>e.fullText)));if(n===r)return;r=n,0===e.length?o.textContent="ריק":o.textContent=document.title||"צ׳אט";const i=o.textContent.trim().charAt(0);p(i)?o.style.direction="rtl":o.style.direction="ltr";const l=s.value.trim().toLowerCase();d.innerHTML="";const a=e.filter((e=>e.fullText.toLowerCase().includes(l)));if(d.classList.toggle("scrollable",a.length>10),0===a.length){const e=document.createElement("div");return e.textContent="לא נמצאו שאלות",e.style.textAlign="center",e.style.opacity="0.7",void d.appendChild(e)}a.forEach((({el:e,text:n,index:o,fullText:i})=>{const l=document.createElement("div");l.textContent=n||`שאלה ${o+1}`,l.title=i;const a=n[0];p(a)?(l.style.direction="rtl",l.style.textAlign="right"):(l.style.direction="ltr",l.style.textAlign="left"),l.addEventListener("click",(t=>{t.preventDefault(),e.scrollIntoView({behavior:"smooth",block:"center"}),e.style.transition="background-color .5s";const n=e.style.backgroundColor;e.style.backgroundColor="yellow",setTimeout((()=>{e.style.backgroundColor=n||""}),1e3)})),d.appendChild(l)}))}c.addEventListener("click",(()=>{t.style.display="none"})),a.addEventListener("click",(()=>{const e=t.classList.toggle("collapsed");a.textContent=e?"+":"-"})),l.addEventListener("click",(()=>{const e=s.classList.toggle("visible");e?s.focus():(s.value="",m())})),s.addEventListener("input",(()=>{m()}));let h=!1,v,g,b;function y(e){if(!h)return;let n=g+(e.clientX-v),o=b+(e.clientY-b);n=Math.max(0,Math.min(window.innerWidth-t.offsetWidth-10,n)),o=Math.max(0,Math.min(window.innerHeight-t.offsetHeight-10,o)),t.style.right="auto",t.style.left=`${n}px`,t.style.top=`${o}px`}n.addEventListener("mousedown",(e=>{h=!0,v=e.clientX,b=e.clientY;const n=t.getBoundingClientRect();g=n.left,b=n.top,e.preventDefault()})),window.addEventListener("mousemove",y),window.addEventListener("mouseup",(()=>{h=!1}));new MutationObserver((()=>{m()})).observe(document.body,{childList:!0,subtree:!0,characterData:!0}),m()})();


  



יום חמישי, 12 ביוני 2025

אחסון אתרים בחינם ע"י github

בשביל לאחסן אתרים ללא הגבלת זמן נשתמש בטריק דרך חשבון github שלנו

  1. ניצור repo בשם שנבחר
  2. ניצור או נוסיף את קובץ עמוד האינטרנט שלנו (עדיף שם קובץ index.html)
  3. בתוך האתר של github נלחץ על הקובץ שיצרנו ונעתיק את הכתובת של העמו המתקבל: https://github.com/snirex/snir-resume/blob/main/index.html
  4. נלך אל הכתובת https://raw.githack.com ונזין בתיבת הטקסט העליונה את הכתובת שהעתקנו
  5. נבחר את הכתובת שנרצה:
    אם בשביל development:
    - שינויים חדשים יתעדכנו בתוך מספר דקות
    - תעבורה מוגזמת תנותב באופן זמני לכתובות CDN מתאימות
    אם בשביל production:
    - אין מגבלות תעבורה. הקבצים מוגשים דרך רשת ה-CDN של CloudFlare.
    - ניתן לבצע אופטימיזציה אוטומטית לקבצים אם מוסיפים את הפרמטר ?min=1 לכתובת.
    - השתמש בתג מסוים (tag) או במזהה commit ספציפי בכתובת ה-URL (ולא בענף - branch). הקבצים מאוחסנים במטמון לצמיתות לפי כתובת ה-URL. מחרוזת השאילתה (Query string) לא נלקחת בחשבון.



raw.githack.com