יום שישי, 11 ביולי 2025

מזונות בריאים

להציג עוד

1️⃣

אמרו למשל שקפה לא בריא.

שתיית קפה שחור יוצרת השפעה שמגינה על הגוף מפני סוכרת, מפחיתה סיכונים לאלצהיימר ולפרקינסון ומונעת סוגים מסוימים של סרטן הכבד, שחמת, הפטיטיס c ושומנים בכבד.

שתיית קפה שחור מורידה באופן דרסטי את הסיכון ללקות בסרטן המעי הגס והכליות, בבעיות בקצב הלב ובשבץ מוחי, והוא אחד מנוגדי החִמצון החזקים בעולם, לא רק לשתייה. הוא אנטי־אייג'ינג מוכח  ונמצא בהרבה מסכות פילינג לפנים ולגוף.

במרפאות רפואה טבעית מבצעים בשנים האחרונות  "חוקן קפה" לניקוי מושלם של המעי הגס.

סוכר בקפה שחור לאחר ארוחה דשנה מגביר את קצב חילוף החומרים בגוף ומונע נמנום.

השם הרע שיצא לקפה בשנים האחרונות נובע בעיקר מצריכה לקויה. על מנת להרויח את כל היתרונות הבריאותיים של הקפה, חשוב לשתות כוס מים לפני ,כך הוא אינו מכווץ את כלי הדם ולא גורם לפלפיטציות ויובש בעור


2️⃣

שמן קיק.

שמן הקיק היה עד לפני שנים ספורות עוד שמן נחמד על מדף השמנים הקוסמטיים, שערכו זול ואיכותו לא מוכרת.

בשנים האחרונות, עם עליית קרנה של הרפואה האלטרנטיבית והמידע המונגש לציבור חינם אין כסף, מופיע שמן הקיק בקדמת הבמה בזכות יכולותיו הסגוליות המופלאות לטפל בהמון מצבים רפואיים, מטיפוח שיער, דרך קומפרסים לכאב וחבישות שמן לדלקות ולריפוי בלוטת התריס ועד לשילובו בריפוי סוגי סרטן מסוימים.

למרות סגולות הריפוי הנפלאות שלו, לשמן קיק יש תדר אנושי הוא "משדר על הגל"  בו האדם משתמש לכן לעיתים הוא הפכפך כביכול  עושה "דווקא" לאדם  שבתדר נמוך, למשל הוא מזרז עיכול.והוא מאט. מזרז תהליכי לידה – מאט. מלחח את העור – מייבש. 

והכל בהתאם למשתמש.

שמן קיק מסיר נפיחויות בבלוטות לימפה, מטפל בבלוטת התריס, בכאבי מפרקים בדלקות ועוד. מספיק להניח רטיה ספוגה בשמן הטוב הזה והפלא מתרחש.


3️⃣

השמש מסוכנת?

כל קרן שמש מכילה חלקיקי פוטונים שבמגע עם העור הם חודרים והורסים דנ"א פגום ובונים דנ"א חדש, וכך הגוף מרפא את עצמו. יכולת הריפוי של השמש כל כך עוצמתית   שמרפסות סולאריום קיימות עוד מקדמת דנא, מכוני ריפוי מחזיקים במכשירים שמדמים אור  שמש 

וכמובן

פוטותרפיה.

השמש מחסלת הליקובקטר פילורי, פטריות בציפורן, מחלות מעיים, פסוריאזיס, ואפילו סוגי סרטן שונים.

מחקרים בחו"ל מגלים כי אנשי עיר המתמגנים באופן עקבי מהשמש הם חלשים, חולים וסובלים מבעיות בשיעורים ניכרים הרבה יותר מאנשים הגרים בכפרים נידחים, בארצות נחשלות או בהרים מרוחקים שאינם מתמגנים מהשמש.


4️⃣

🥚🍳🥚🍳

ביצים זה מסוכן?

ביצים הן ה"סופר פוד" המוכר והנמכר ביותר בעולם. הביצים מכילות את כל חומצות השומן, המינרלים, הוויטמינים, היסודות והקורט שבעולם, מה שהופך אותן למאכל הבריא ביותר.

טסים לאי בודד? 

קחו ביצים.

חוץ מזה הביצה מכילה כולין, שהוא מוליך עצבי גבוה, ולציטין, שהיא חומצת השומן החיוניות ביותר לבניית תאי המוח. אכילה של שתיים־שלוש ביצים באופן יום יומי  משפרת את התפקוד המוחי, מונעת אלצהיימר, מרפאת כבד במצוקה, מגינה מקטרקט ומניוון מקולרי ומחזקת את רשתית העין 

(בבחינת "דומה בדומה ירפא").


5️⃣

🍖🥩🍖🥩

כולסטרול "גבוה" וכולסטרול "רע" אלו מושגים מתחום התעשייה הרפואית.

כולסטרול הוא שומן חיוני מאוד לבריאותנו.

הוא מיוצר באופן טבעי במוח והוא חלק קריטי ובלתי נפרד לתהליכים ביולוגיים מרכזיים בגופנו.

הגוף באמת מייצר בעצמו כמעט 80% ממנו אבל אצל כל אדם באופן ובמידה שונים, אבל מאוד מדויקים ובצורה מבוקרת וטבעית. 

"מה רבו מעשיך ה'" 

הוא מייצר את הורמונים, 

הופך לוויטמין D בעזרת קרני השמש, 

מונע מחלות ניווניות, 

מייצר חומצות מרה בכבד, המסייעות בפירוק השומן והמזון.

מחקרים בלתי תלויים מוכיחים שכנראה דווקא התרופות להורדת כולסטרול גורמות לאלצהיימר, לאובדן זיכרון, למחלות קשות ולסרטן.

שווה לבדוק מדי פעם תיאוריות באופן עצמאי לגבי הכולסטרול, כי כמעט בכל עשור הערכים משתנים ואיתם ההנחיות.


6️⃣

סודה לשתייה:

מעניין – זהו רכיב שנמצא בתרופות מרשם להקלה על  צרבת, אבל לא מומלץ על ידי רופאים לטיפול ביתי בצרבת.

סודה לשתייה מחטאת, מרככת, מעכבת התפתחות חיידקים בפה, מטפלת בדלקות חניכיים, מרגיעה את העור לאחר עקיצה, מנקה את עור הפנים, מטהרת  את האוויר והאוירה מסירה פטריות בציפורן, עובש  ועוד...


7️⃣

פירמידת המזון:

חמש ארוחות ביום – תאוריות שמשלו בכיפה עשרות שנים.


היום מבינים שככל שאתה אוכל פחות אתה בריא יותר. כשמערכת העיכול עובדת – מערכת החיסון מושבתת.  הורמון הגרלין מופרש בקיבה רק כשרעבים ומשתתף בעשרות תהליכי ניקוי ובריאות בגוף. כשלא רעבים, התהליכים  פשוט לא מתרחשים.

תדירות גבוהה של אכילה גורמת להפרשה מתמדת של אינסולין, להשמנת־יתר ולמחלות מטאבוליות.

פחות אוכל – פחות מחלות. ריפוי דרך תזונה מחזורית  מועטה וחזרה לפשטות הטבעית של פעם.


להציג עוד

יום חמישי, 10 ביולי 2025

צביעת שיחות ב-ChatGpt

הוספת אפשרות לצבוע שיחות (צאטים) ב-ChatGpt
  1. לחץ כאן כדי להעתיק את הקוד
  2. לחץ ctrl+d כדי ליצור סימניה
  3. שנה את שם הסימניה ל-צביעת שיחות, ובמקום הכתובת, הדבק את הטקסט שהעתקת בסעיף 1
  4. בזמן שימוש באתר ChatGPT, לחץ על הסימניה ששמרת כדי להציג את התפריט
javascript:(function(){
  let s = JSON.parse(localStorage.getItem('navMarkerSettings')) || {
    markers: [{symbol:'📌',bgColor:'#fff8b3',color:''}],
    minimized: false
  };
  function save() {
    localStorage.setItem('navMarkerSettings', JSON.stringify(s));
  }
  function h() {
    document.querySelectorAll('nav a').forEach(c=>{
      let t=c.textContent.trim();
      c.style.backgroundColor='';
      c.style.color='';
      s.markers.forEach(m=>{
        if(t.startsWith(m.symbol)||t.endsWith(m.symbol)){
          c.style.backgroundColor=m.bgColor||'';
          c.style.color=m.color||'';
        }
      });
      c.style.fontWeight='';
      if(c.hasAttribute('data-active')){
        c.style.fontWeight='bold';
      }
    });
  }
  h();
  const n=document.querySelector('nav');
  if(n){
    new MutationObserver(h).observe(n,{childList:true,subtree:true,attributes:true,attributeFilter:['data-active']});
  }
  if(!document.getElementById('markerConfigMenu')){
    const m=document.createElement('div');
    m.id='markerConfigMenu';
    m.style.position='fixed';
    m.style.top='55px';
    m.style.right='10px';
    m.style.width='270px';
    m.style.background='#fefefe';
    m.style.border='1px solid #333';
    m.style.borderRadius='8px';
    m.style.boxShadow='0 4px 12px rgba(0,0,0,0.2)';
    m.style.fontFamily='sans-serif';
    m.style.zIndex='9999';
    m.style.overflow='hidden';
    m.style.opacity='0.9';
    m.style.cursor='move';
    m.innerHTML='';
    document.body.appendChild(m);
    const hd=document.getElementById('menuHeader'),
          tb=document.getElementById('toggleMenu'),
          ct=document.getElementById('menuContent'),
          cl=document.getElementById('closeMenu');
    // מצב פתיחה/סגירה לפי saved
    ct.style.display = s.minimized ? 'none' : 'block';
    tb.textContent = s.minimized ? '+' : '−';
    tb.onclick=()=>{
      if(ct.style.display==='none'){
        ct.style.display='block';
        tb.textContent='−';
        s.minimized = false;
      }else{
        ct.style.display='none';
        tb.textContent='+';
        s.minimized = true;
      }
      save();
    };
    cl.onclick=()=>{
      m.style.transition='opacity 0.2s ease';
      m.style.opacity='0';
      setTimeout(()=>{m.remove();},500);
    };
    function r(){
      const l=document.getElementById('markerList');
      l.innerHTML='';
      if(s.markers.length===0){
        l.innerHTML='אין סימנים מוגדרים.';
      }
      s.markers.forEach((m,i)=>{
        const d=document.createElement('div');
        d.style.marginBottom='4px';
        d.style.background='#f0f0f0';
        d.style.padding='4px 30px 4px 4px';
        d.style.borderRadius='4px';
        d.style.position='relative';
        d.innerHTML=`${m.symbol} BG:       Text:     `;
        const b=document.createElement('button');
        b.textContent='🗑️';
        b.style.position='absolute';
        b.style.right='-25px';
        b.style.top='50%';
        b.style.transform='translateY(-50%)';
        b.style.background='none';
        b.style.border='none';
        b.style.cursor='pointer';
        b.onclick=()=>{
          s.markers.splice(i,1);
          save();
          r();
          h();
        };
        d.appendChild(b);
        l.appendChild(d);
      });
    }
    r();
    document.getElementById('addMarker').onclick=()=>{
      const sy=document.getElementById('newSymbol').value.trim(),
            bg=document.getElementById('newBg').value,
            co=document.getElementById('newColor').value;
      if(sy){
        s.markers.push({symbol:sy,bgColor:bg,color:co});
        save();
        r();
        h();
      }
    };
    document.getElementById('resetMarkers').onclick=()=>{
      if(confirm('לאפס הכל?')){
        localStorage.removeItem('navMarkerSettings');
        s={markers:[], minimized: false};
        r();
        h();
      }
    };
    let x=0,y=0,mx=0,my=0;hd.onmousedown=d;
    function d(e){
      e=e||window.event;e.preventDefault();
      mx=e.clientX;my=e.clientY;
      document.onmouseup=c;document.onmousemove=f;
    }
    function f(e){
      e=e||window.event;e.preventDefault();
      x=mx-e.clientX;y=my-e.clientY;
      mx=e.clientX;my=e.clientY;
      m.style.top=(m.offsetTop-y)+'px';
      m.style.left=(m.offsetLeft-x)+'px';
      m.style.right='auto';
    }
    function c(){document.onmouseup=null;document.onmousemove=null;}
  }
})();


שימוש בתוסף:
בתיבת התוסף יש להגדיר תו רצוי וצבעים - למשל
תוצבע רקעצבע טקסט
>      
יש לשנות את שם השיחה הרצויה שתתחיל או תסתיים בתו שנבחר.
כך, כל שיחה תיצבע בצבע ע"י התחלת או סיום השיחה בתו שהוגדר

יום ראשון, 6 ביולי 2025

תפריט שאלות של השיחה הנוכחית לגוגל ג'מיני

תפריט פרומפטים לגוגל ג'מיני:
  1. העתק את הקוד
  2. עבור אל האתר של Google Gemini
  3. לחץ F12
  4. הדבק את הקוד ע"י לחיצת ctrl+v,
  5. ולחץ Enter
(() => {
  // יצירת מדיניות TrustedTypes אם קיימת
  const policy = window.trustedTypes?.createPolicy('default', {
    createHTML: (input) => input
  });

  const style = document.createElement('style');
  // שימוש ב-TrustedHTML ל-style.innerHTML
  style.innerHTML = policy ? policy.createHTML(`
    #floatingMenu {
      position: fixed;
      top: 100px;
      left: 10px;
      width: 270px;
      max-height: 400px;
      background: rgba(0,0,0,0.6);
      color: white;
      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 0.4s ease;
    }
    #floatingMenu.collapsed {
      max-height: 40px;
    }
    #floatingMenuHeader {
      padding: 8px 10px;
      background: rgba(0,0,0,0.8);
      cursor: move;
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-weight: bold;
    }
    #floatingMenuTitle {
      flex-grow: 1;
      text-align: center;
    }
    #floatingMenuControls {
      display: flex;
      align-items: center;
    }
    #floatingMenuControls > button {
      cursor: pointer;
      margin-left: 10px;
      font-weight: bold;
      background: none;
      border: none;
      color: white;
      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 0.4s ease, opacity 0.4s ease, margin 0.4s ease;
      direction: rtl;
    }
    #searchInput.visible {
      max-height: 40px;
      opacity: 1;
      pointer-events: auto;
      margin: 5px 10px;
    }
    #floatingMenuList {
      padding: 5px 10px;
      transition: opacity 0.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,0.1);
      cursor: pointer;
      white-space: nowrap;
      text-overflow: ellipsis;
    }
    #floatingMenuList div:hover,
    #floatingMenuList div:focus {
      background: rgba(255,255,255,0.25);
      outline: none;
    }
    #floatingMenu.collapsed #searchInput,
    #floatingMenu.collapsed #floatingMenuList {
      opacity: 0;
      pointer-events: none;
      height: 0;
      padding: 0 10px;
      overflow: hidden !important;
      transition: opacity 0.4s ease, height 0.4s ease, padding 0.4s ease, margin 0.4s ease;
    }
  `) : `
    #floatingMenu {
      position: fixed;
      top: 100px;
      right: 10px;
      width: 270px;
      max-height: 400px;
      background: rgba(0,0,0,0.6);
      color: white;
      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 0.4s ease;
    }
    #floatingMenu.collapsed {
      max-height: 40px;
    }
    #floatingMenuHeader {
      padding: 8px 10px;
      background: rgba(0,0,0,0.8);
      cursor: move;
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-weight: bold;
    }
    #floatingMenuTitle {
      flex-grow: 1;
      text-align: center;
    }
    #floatingMenuControls {
      display: flex;
      align-items: center;
    }
    #floatingMenuControls > button {
      cursor: pointer;
      margin-left: 10px;
      font-weight: bold;
      background: none;
      border: none;
      color: white;
      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 0.4s ease, opacity 0.4s ease, margin 0.4s ease;
      direction: rtl;
    }
    #searchInput.visible {
      max-height: 40px;
      opacity: 1;
      pointer-events: auto;
      margin: 5px 10px;
    }
    #floatingMenuList {
      padding: 5px 10px;
      transition: opacity 0.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,0.1);
      cursor: pointer;
      white-space: nowrap;
      text-overflow: ellipsis;
      overflow-x: clip;
    }
    #floatingMenuList div:hover,
    #floatingMenuList div:focus {
      background: rgba(255,255,255,0.25);
      outline: none;
    }
    #floatingMenu.collapsed #searchInput,
    #floatingMenu.collapsed #floatingMenuList {
      opacity: 0;
      pointer-events: none;
      height: 0;
      padding: 0 10px;
      overflow: hidden !important;
      transition: opacity 0.4s ease, height 0.4s ease, padding 0.4s ease, margin 0.4s ease;
    }
  `;

  document.head.appendChild(style);

  const menu = document.createElement('div');
  menu.id = 'floatingMenu';
  menu.setAttribute('role', 'region');
  menu.setAttribute('aria-label', 'תפריט שאלות');

  const header = document.createElement('div');
  header.id = 'floatingMenuHeader';
  header.setAttribute('role', 'banner');

  const title = document.createElement('div');
  title.id = 'floatingMenuTitle';
  // החלפה ל-textContent במקום innerHTML כשמדובר בטקסט
  title.textContent = 'ריק'; // ברירת מחדל

  const controls = document.createElement('div');
  controls.id = 'floatingMenuControls';

  const toggleSearchBtn = document.createElement('button');
  toggleSearchBtn.id = 'toggleSearchBtn';
  toggleSearchBtn.textContent = '?'; // טקסט בלבד

  const collapseBtn = document.createElement('button');
  collapseBtn.id = 'collapseBtn';
  collapseBtn.textContent = '-'; // טקסט בלבד

  const closeBtn = document.createElement('button');
  closeBtn.id = 'closeBtn';
  closeBtn.textContent = '×'; // טקסט בלבד

  //controls.appendChild(toggleSearchBtn);
  controls.appendChild(collapseBtn);
  controls.appendChild(closeBtn);
  header.appendChild(title);
  header.appendChild(controls);

  const searchInput = document.createElement('input');
  searchInput.id = 'searchInput';
  searchInput.type = 'search';
  searchInput.placeholder = 'חפש שאלות...';

  const listContainer = document.createElement('div');
  listContainer.id = 'floatingMenuList';

  menu.appendChild(header);
  menu.appendChild(searchInput);
  menu.appendChild(listContainer);
  document.body.appendChild(menu);

  function isHebrewChar(char) {
    return /[\u0590-\u05FF]/.test(char);
  }

  function hasClassOrParentHasClass(el, className) {
    while (el) {
      if (el.classList && el.classList.contains(className)) {
        return true;
      }
      el = el.parentElement;
    }
    return false;
  }

  function getQuestions() {
    const qs = document.querySelectorAll('.query-text p');

    const questions = [];
    qs.forEach((q, i) => {
      let len = 27;
      if (hasClassOrParentHasClass(q, 'text-page-header')) return;
      let text = q.textContent.trim().replace(/\s+/g, ' ');      
      if (text.length > len) text = text.slice(0, len) + '…';
      questions.push({ el: q, text, index: i, fullText: q.innerHTML.trim() });
    });
    return questions;
  }

  let previousQuestionsJSON = null;

  function updateList() {
    const questions = getQuestions();
    const currentQuestionsJSON = JSON.stringify(questions.map(q => q.fullText));
    if (currentQuestionsJSON === previousQuestionsJSON) return;
    previousQuestionsJSON = currentQuestionsJSON;

    if (questions.length === 0) {
      title.textContent = 'ריק';
    } else {
      // כאן כן innerHTML כי זה יכול לכלול תווים מיוחדים מהכותרת, אבל מומלץ להחליף ל-textContent אם אפשר
      // פה נניח שהכותרת היא טקסט בלבד, לכן:
      title.textContent = document.title || 'צ׳אט';
    }

    // 👇 בדיקת כיוון הכותרת
    const firstChar = title.textContent.trim().charAt(0);
    if (isHebrewChar(firstChar)) {
      title.style.direction = 'rtl';
    } else {
      title.style.direction = 'ltr';
    }

    const searchTerm = searchInput.value.trim().toLowerCase();
    listContainer.innerHTML = ''; // כאן צריך לרוקן תוכן - אין דרך אחרת

    const filtered = questions.filter(q => q.fullText.toLowerCase().includes(searchTerm));
    listContainer.classList.toggle('scrollable', filtered.length > 10);

    if (filtered.length === 0) {
      const noResultDiv = document.createElement('div');
      noResultDiv.textContent = 'לא נמצאו שאלות';
      noResultDiv.style.textAlign = 'center';
      noResultDiv.style.opacity = '0.7';
      listContainer.appendChild(noResultDiv);
      return;
    }

    filtered.forEach(({ el, text, index, fullText }) => {
      const item = document.createElement('div');
      // כאן אפשר להשתמש ב-textContent כי זה טקסט בלבד
      item.textContent = text || `שאלה ${index + 1}`;
      item.title = fullText;

      if (isHebrewChar(text[0])) {
        item.style.direction = 'rtl';
        item.style.textAlign = 'right';
      } else {
        item.style.direction = 'ltr';
        item.style.textAlign = 'left';
      }

      item.addEventListener('click', e => {
        e.preventDefault();
        el.scrollIntoView({ behavior: 'smooth', block: 'center' });
        el.style.transition = 'background-color 0.5s';
        const origBG = el.style.backgroundColor;
        el.style.backgroundColor = 'yellow';
        setTimeout(() => {
          el.style.backgroundColor = origBG || '';
        }, 1000);
      });

      listContainer.appendChild(item);
    });
  }

  closeBtn.addEventListener('click', () => {
    menu.style.display = 'none';
  });

  collapseBtn.addEventListener('click', () => {
    const isCollapsed = menu.classList.toggle('collapsed');
    collapseBtn.textContent = isCollapsed ? '+' : '-';
  });

  toggleSearchBtn.addEventListener('click', () => {
    const visible = searchInput.classList.toggle('visible');
    if (visible) {
      searchInput.focus();
    } else {
      searchInput.value = '';
      updateList();
    }
  });

  searchInput.addEventListener('input', () => {
    updateList();
  });

  let isDragging = false, dragStartX, dragStartY, menuStartX, menuStartY;

  header.addEventListener('mousedown', e => {
    isDragging = true;
    dragStartX = e.clientX;
    dragStartY = e.clientY;
    const rect = menu.getBoundingClientRect();
    menuStartX = rect.left;
    menuStartY = rect.top;
    e.preventDefault();
  });

  window.addEventListener('mousemove', e => {
    if (!isDragging) return;
    let newX = menuStartX + (e.clientX - dragStartX);
    let newY = menuStartY + (e.clientY - dragStartY);
    const maxX = window.innerWidth - menu.offsetWidth - 10;
    const maxY = window.innerHeight - menu.offsetHeight - 10;
    newX = Math.max(0, Math.min(maxX, newX));
    newY = Math.max(0, Math.min(maxY, newY));
    menu.style.right = 'auto';
    menu.style.left = `${newX}px`;
    menu.style.top = `${newY}px`;
  });

  window.addEventListener('mouseup', () => {
    isDragging = false;
  });

  const observer = new MutationObserver(() => {
    updateList();
  });

  observer.observe(document.body, { childList: true, subtree: true, characterData: true });

  updateList();
})();

	

יום חמישי, 3 ביולי 2025

chrome ext


  {
  "manifest_version": 3,
  "name": "תפריט פרומפטים ל-ChatGPT",
  "version": "1",
  "author" :"Snir Elgabsi",
  "description": "הוספת תפריט פרומפטים ל-ChatGPT. לחיצה על כל שורה בתפריט תגלול אל הפרומפט המבוקש. חיוני בשיחות ארוכות עם ChatGpt",
  "icons": {
    "16": "icon128.png",
    "48": "image.png",
    "128": "image.png"
  },
  "content_scripts": [
    {
      "matches": ["https://chat.openai.com/*","https://chatgpt.com/*"],
      "js": ["content.js"]
    }
  ],
  "permissions": [],
  "host_permissions": ["https://chat.openai.com/*"]
}
  
snir




יום שני, 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



יום רביעי, 9 באפריל 2025

הורדת Windows 10

הכנסו אל אתר האינטרנט של הורדת Windows 10 (קישור)

אם אתם משתמשים בגוגל כרום (כנראה):
1. לחצו על F12 או לחצו לחיצה ימנית איפשהו בדף ובחרו ב- "בדיקה" - בשביל להיכנס למצב Developer
2. לחצו ctrl+shift+M כדי להכנס למצב פיתוח לטלפון נייד

אם משתמשים בדפדפן Microsoft Edge:
1. לחצו על F12 או לחצו לחיצה ימנית איפשהו בדף ובחרו ב- "בדיקה" - בשביל להיכנס למצב Developer
2. בסרגל העליון לחצו על + , וברשימה הנפתחת בחרו ב- Network Conditions
3. הסירו את סימון V מאפשרות Use browser default , וברשימה הנפתחת בחרו ב-BlackBerry-BB10

- רעננו את אתר האינטרנט
- ברשימה הנפתחת בחרו ב-Windows 10 ולחצו "אשר"
- ברשימה הנפתחת בחרו בשפה הרצויה (עברית) ולחצו אשר
- לחצו על Download bit-64



יום חמישי, 5 בספטמבר 2024

ChatGPT - תיקון ימין-שמאל בכתיבת עברית

יש בעיה בכתיבת שאלות ב-ChatGPT בעברית במחשב - הכתיבה היא רק משמאל לימין.
כתבתי תוסף לכרום שמתקן את זה
ניתן להוריד את התוסף מחנות גוגל כרום

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

  1. לחץ כאן כדי להעתיק את הקוד
  2. לחץ ctrl+d
  3. שנה את שם הסימניה ל-שניר, ובמקום כתובת, הדבק את הטקסט שהעתקת בסעיף 1
javascript:(function(){let textareaDirection='rtl';function toggleDirection(){textareaDirection=textareaDirection==='rtl'?'ltr':'rtl';const textarea=document.querySelector('#prompt-textarea');if(textarea){textarea.style.direction=textareaDirection;}const img=document.querySelector('#direction-toggle-button img');if(img){img.style.transform=textareaDirection==='ltr'?'scaleX(-1)':'scaleX(1)';}}function toggleMarkdownDirection(){const markdowns=document.querySelectorAll('.markdown');markdowns.forEach(el=>{el.dir=el.dir==='rtl'?'ltr':'rtl';});const img=document.querySelector('#markdown-toggle-button img');if(img){img.style.transform=img.style.transform==='scaleX(-1)'?'scaleX(1)':'scaleX(-1)';}}function toggleWhitespaceStyle(){document.querySelectorAll('.whitespace-pre-wrap').forEach(el=>{const isActive=el.classList.contains('styled-q');if(isActive){el.classList.remove('styled-q');el.style.border='';el.style.borderRadius='';el.style.background='';}else{el.classList.add('styled-q');el.style.border='1px solid red';el.style.borderRadius='10px';el.style.background='lightyellow';}});}function jumpToNext(){const messages=document.querySelectorAll('[data-message-author-role]');let current=[...messages].findIndex(m=>m.getBoundingClientRect().top>100);if(current!==-1&&messages[current]){messages[current].scrollIntoView({behavior:'smooth',block:'start'});}}function jumpToPrevious(){const messages=[...document.querySelectorAll('[data-message-author-role]')];if(messages.length===0)return;let index=messages.findIndex(m=>m.getBoundingClientRect().top>=10);if(index===-1){index=messages.length;}if(index>0){messages[index-1].scrollIntoView({behavior:'smooth',block:'start'});}}function toggleQButtonGlow(){const qButton=document.querySelector('#q-style-toggle-button');if(!qButton)return;const glowing=qButton.classList.toggle('glowing-q');if(glowing){qButton.style.boxShadow='0 0 10px 4px yellow';}else{qButton.style.boxShadow='0 2px 6px rgba(0,0,0,0.2)';}}function createTooltip(btn){let tooltip=document.createElement('div');tooltip.textContent='Snir Elgabsi';tooltip.style.cssText=`position:absolute;bottom:120%;left:50%;transform:translateX(-50%) scale(0.5);padding:5px 10px;background:rgba(0,0,0,0.7);color:white;border-radius:6px;font-size:0.9rem;opacity:0;transition:opacity 0.3s ease, transform 0.3s ease;pointer-events:auto;cursor:pointer;z-index:10000;white-space:nowrap;`;tooltip.onclick=()=>{window.open('https://snir.blogspot.com','_blank');};btn.appendChild(tooltip);setTimeout(()=>{tooltip.style.opacity='1';tooltip.style.transform='translateX(-50%) scale(1)';},30);setTimeout(()=>{tooltip.style.opacity='0';tooltip.style.transform='translateX(-50%) scale(0.5)';setTimeout(()=>{if(tooltip.parentElement){tooltip.remove();}},300);},5030);btn._tooltip=tooltip;}function removeTooltip(btn){if(btn._tooltip){btn._tooltip.style.opacity='0';btn._tooltip.style.transform='translateX(-50%) scale(0.5)';setTimeout(()=>{if(btn._tooltip){btn._tooltip.remove();btn._tooltip=null;}},300);}}function addTooltipEvents(btn){let hoverTimeout=null;let leaveTimeout=null;btn.addEventListener('mouseenter',()=>{clearTimeout(leaveTimeout);hoverTimeout=setTimeout(()=>createTooltip(btn),1500);});btn.addEventListener('mouseleave',()=>{clearTimeout(hoverTimeout);leaveTimeout=setTimeout(()=>removeTooltip(btn),1000);});}function makeButtonImage(id,title,imgSrc,imgAlt,clickHandler){const btn=document.createElement('button');btn.id=id;btn.title=title;btn.style.cssText='width:2.2rem;height:2.2rem;border-radius:50%;background:white;color:black;border:1px solid lightgray;font-size:1.2rem;box-shadow:0 2px 6px rgba(0,0,0,0.2);cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;position:relative;';btn.onmouseover=()=>btn.style.backgroundColor='#f0f0f0';btn.onmouseout=()=>btn.style.backgroundColor='white';btn.onclick=(e)=>{e.preventDefault();clickHandler();};const img=document.createElement('img');img.src=imgSrc;img.alt=imgAlt;img.style.cssText='width:1.5rem;height:1.5rem;object-fit:contain;pointer-events:none;';btn.appendChild(img);addTooltipEvents(btn);return btn;}const imgPromptDir = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAD/UExURenp6c7OzrKysnl5eVZWVpOTkwAAAAEBAaGhoW1tbQMDA5ycnI2NjVtbW8bGxsjIyMrKyrGxscXFxd3d3dLS0ubm5ujo6IuLi3d3d+Li4uTk5E1NTezs7CYmJicnJ1BQUI6OjtXV1ZKSknZ2dpqamgICAt/f36ampnJyclxcXDk5OaqqqrCwsK+vr7+/v66urnR0dMPDw29vb+7u7rW1tSwsLIWFhUJCQkRERMTExNTU1AYGBsfHx3FxcWtra8nJybOzswQEBE5OTjMzM6mpqa2trdzc3OXl5UxMTKWlpUtLS52dnUlJSZ6enuPj40hISMvLy0ZGRqSkpOvr6wAAAKVmCqgAAABVdFJOU////////////////////////////////////////////////////////////////////////////////////////////////////////////////wCwoQfPAAAACXBIWXMAAA7BAAAOwQG4kWvtAAAAGHRFWHRTb2Z0d2FyZQBQYWludC5ORVQgNS4xLjgbaeqoAAAAtmVYSWZJSSoACAAAAAUAGgEFAAEAAABKAAAAGwEFAAEAAABSAAAAKAEDAAEAAAACAAAAMQECABAAAABaAAAAaYcEAAEAAABqAAAAAAAAANl2AQDoAwAA2XYBAOgDAABQYWludC5ORVQgNS4xLjgAAwAAkAcABAAAADAyMzABoAMAAQAAAAEAAAAFoAQAAQAAAJQAAAAAAAAAAgABAAIABAAAAFI5OAACAAcABAAAADAxMDAAAAAA5X1phWJRlb4AAAFhSURBVEhL5ZRXV8JAEIUpurEiorGAHdGIxoYo9i5WbPP/f4uzmZFkl6xsXuV7yHLP3C9kYU9SkJh/rqTSmWyfQponRKfSLxBHXtoM8IjoUAa5PxSUHUeGYZ4RujLCXSFGc2P5cVwz+cIEDwlNmaS6JIvRxXWKJiGaMh3uYgbjLK5FmoRoSonqEktlbp7qEltlgeoS2wdbpLrEVllKvv1lqktsFVhp/5XWCpR/D5i9AquBUEmiwNq6t1FN9C0Bm8mVreSK36vKtievO0Ls4mKl7AmxXwM4qFcPMRWPGg2XBiGacoy3FSccDKhKQRp5DiYUxcpQlBwKpwUOZiLKmTzy9bJ3HsfFJbeiCv6gFe31HeWKa1GlVhLXfyg+15QHc2/Qub3L+HHcP3BL3X7zEe/2xMFMVIHmMzovHIwoChRf0XnjYEJVoPWOzgcHA5oCrU/xxR9N6Ap8dzmUMUp3eloB+AGGLqjp2OH2dAAAAABJRU5ErkJgg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b3YBipPLMTJsErwJ38R2Z8hk+qreWLHz5imp8dwFKYiO5H0gAcI1+Qz9hEl9ogZPmY8O1Vq98s8q5iKYmPJ33ADngKJ72tyuAd7qbfDDAMT6D0uhbLv4h55johk5nwtuz8lQThVeYChDRlKykmTOYGltajKZPIBbZkcpOEJiyZ3CWh6YLH8A5u8AOHw5FXCoVfKaQOUfKxTTgAAAAASUVORK5CYII=';const dirBtn=makeButtonImage('direction-toggle-button',textareaDirection==='rtl'?'כיוון כתיבה מימין לשמאל - Ctrl+Shift':'כיוון כתיבה משמאל לימין - Ctrl+Shift',imgPromptDir,'כיוון כתיבה',toggleDirection);dirBtn.querySelector('img').style.transform=textareaDirection==="ltr"?"scaleX(-1)":"scaleX(1)";const mdBtn=makeButtonImage('markdown-toggle-button','החלף כיוון כתיבה של התשובות',imgMarkdownDir,'כיוון תשובות',toggleMarkdownDirection);const qBtn=document.createElement('button');qBtn.id='q-style-toggle-button';qBtn.title='הפעל/בטל עיצוב על whitespace-pre-wrap';qBtn.textContent='Q';qBtn.style.cssText=dirBtn.style.cssText;qBtn.onclick=(e)=>{e.preventDefault();toggleWhitespaceStyle();toggleQButtonGlow();};addTooltipEvents(qBtn);const nextBtn=makeButtonImage('next-snir-button','קפוץ לשאלה הבאה - Alt+↓',imgNextBtn,'קפוץ לשאלה הבאה',jumpToNext);const prevBtn=makeButtonImage('prev-snir-button','קפוץ לשאלה הקודמת - Alt+↑',imgPrevBtn,'קפוץ לשאלה הקודמת',jumpToPrevious);function createButtons(){if(document.querySelector('#direction-toggle-button'))return;const textarea=document.querySelector('#prompt-textarea');const buttonContainer=textarea?.closest('form')?.querySelector('div.flex > div.flex');if(!textarea||!buttonContainer)return;let btnGroup=document.querySelector('#custom-btn-group');if(!btnGroup){btnGroup=document.createElement('div');btnGroup.id='custom-btn-group';btnGroup.style.cssText='position:absolute;bottom:13px;right:95px;display:flex;gap:10px;z-index:9999;';buttonContainer.style.position='relative';buttonContainer.appendChild(btnGroup);}btnGroup.appendChild(prevBtn);btnGroup.appendChild(nextBtn);btnGroup.appendChild(mdBtn);btnGroup.appendChild(dirBtn);}document.addEventListener('keydown',function(e){if(e.key==='ArrowUp'&&e.altKey){e.preventDefault();jumpToPrevious();}if(e.key==='ArrowDown'&&e.altKey){e.preventDefault();jumpToNext();}});document.addEventListener('keydown',function(e){if(e.ctrlKey&&e.shiftKey&&!e.altKey){e.preventDefault();toggleDirection();}});const observer=new MutationObserver(()=>{createButtons();});observer.observe(document.body,{childList:true,subtree:true});createButtons();toggleDirection();toggleDirection();})();


דרך שניה

תוסף לדפדפן גוגל כרום

יש ליצור תיקיה חדשה ולשמור בתוכה את הקבצים הבאים:
  1. manifest.json
    {
      "manifest_version": 3,
      "name": "כיוון כתיבת עברית ב-ChatGPT",
      "version": "1.2",
      "author": "Snir Elgabsi",
      "description": "הוספת תפריט קטן לשינוי כיוון כתיבה ב-ChatGPT",
      "icons": {
        "16": "icon.png",
        "48": "icon.png",
        "128": "icon.png"
      },
      "content_scripts": [
        {
          "matches": [
            "https://chat.openai.com/*",
            "https://chatgpt.com/*"
          ],
          "js": [
            "content.js"
          ]
        }
      ],
      "permissions": [],
      "host_permissions": [
        "https://chat.openai.com/*"
        "https://chatgpt.com/*"
      ]
    }
    לחץ כאן כדי להעתיק את הקוד
  2. content.js
    javascript:(function(){
    let textareaDirection = localStorage.getItem('snir-textarea-direction') || 'rtl';
    
    function toggleDirection(){
      textareaDirection = textareaDirection === 'rtl' ? 'ltr' : 'rtl';
      localStorage.setItem('snir-textarea-direction', textareaDirection);
      const textarea = document.querySelector('#prompt-textarea');
      if(textarea){ textarea.style.direction = textareaDirection; }
      const img = document.querySelector('#direction-toggle-button img');
      if(img){ img.style.transform = textareaDirection === 'ltr' ? 'scaleX(-1)' : 'scaleX(1)'; }
    }
    
    function toggleMarkdownDirection(){
      const markdowns=document.querySelectorAll('.markdown');
      markdowns.forEach(el=>{el.dir=el.dir==='rtl'?'ltr':'rtl';});
      const img=document.querySelector('#markdown-toggle-button img');
      if(img){img.style.transform=img.style.transform==='scaleX(-1)'?'scaleX(1)':'scaleX(-1)';}
    }
    
    function toggleWhitespaceStyle(){
      document.querySelectorAll('.whitespace-pre-wrap').forEach(el=>{
        const isActive=el.classList.contains('styled-q');
        if(isActive){
          el.classList.remove('styled-q');
          el.style.border='';el.style.borderRadius='';el.style.background='';
        }else{
          el.classList.add('styled-q');
          el.style.border='2px solid red';
          el.style.borderRadius='10px';
          el.style.boxShadow='0 0 8px 2px red';
          el.style.padding='5px';
        }
      });
    }
    
    function jumpToNext(){	
      const messages = document.querySelectorAll('[data-message-author-role]');
      let current = [...messages].findIndex(m => m.getBoundingClientRect().top > 100);
      if (current !== -1 && messages[current]) {
        messages[current].scrollIntoView({behavior: 'smooth', block: 'start'});
      }
    }
    
    function jumpToPrevious() {
      const messages = [...document.querySelectorAll('[data-message-author-role]')];
      if (messages.length === 0) return;
      let index = messages.findIndex(m => m.getBoundingClientRect().top >= 10);
      if (index === -1) index = messages.length;
      if (index > 0) {
        messages[index - 1].scrollIntoView({ behavior: 'smooth', block: 'start' });
      }
    }
    
    function toggleQButtonGlow(){
      const qButton=document.querySelector('#q-style-toggle-button');
      if(!qButton)return;
      const glowing=qButton.classList.toggle('glowing-q');
      if(glowing){qButton.style.boxShadow='0 0 10px 4px yellow';}
      else{qButton.style.boxShadow='0 2px 6px rgba(0,0,0,0.2)';}
    }
    
    function createTooltip(btn){
      let tooltip = document.createElement('div');
      tooltip.textContent = 'Snir Elgabsi';
      tooltip.style.cssText = `
        position:absolute;
        bottom:120%;
        left:50%;
        transform:translateX(-50%) scale(0.5);
        padding:5px 10px;
        background:rgba(0,0,0,0.7);
        color:white;
        border-radius:6px;
        font-size:0.9rem;
        opacity:0;
        transition:opacity 0.3s ease, transform 0.3s ease;
        pointer-events:auto;
        cursor:pointer;
        z-index:10000;
        white-space:nowrap;
      `;
      tooltip.onclick = () => {
        window.open('https://snir.blogspot.com', '_blank');
      };
      btn.appendChild(tooltip);
      setTimeout(() => {
        tooltip.style.opacity = '1';
        tooltip.style.transform = 'translateX(-50%) scale(1)';
      }, 500);
      setTimeout(() => {
        tooltip.style.opacity = '0';
        tooltip.style.transform = 'translateX(-50%) scale(0.5)';
        setTimeout(() => {
          if (tooltip.parentElement) {
            tooltip.remove();
          }
        }, 300);
      }, 5030);
      btn._tooltip = tooltip;
    }
    
    function removeTooltip(btn){
      if(btn._tooltip){
        btn._tooltip.style.opacity='0';
        btn._tooltip.style.transform='translateX(-50%) scale(0.5)';
        setTimeout(()=>{if(btn._tooltip){btn._tooltip.remove();btn._tooltip=null;}},300);
      }
    }
    
    function addTooltipEvents(btn){
      let hoverTimeout=null;
      let leaveTimeout=null;
      btn.addEventListener('mouseenter',()=>{
        clearTimeout(leaveTimeout);
        hoverTimeout=setTimeout(()=>createTooltip(btn),1500);
      });
      btn.addEventListener('mouseleave',()=>{
        clearTimeout(hoverTimeout);
        leaveTimeout=setTimeout(()=>removeTooltip(btn),1000);
      });
    }
    
    function makeButtonImage(id,title,imgSrc,imgAlt,clickHandler){
      const btn=document.createElement('button');
      btn.id=id;
      btn.title=title;
      btn.style.cssText='width:2.2rem;height:2.2rem;border-radius:50%;background:white;color:black;border:1px solid lightgray;font-size:1.2rem;box-shadow:0 2px 6px rgba(0,0,0,0.2);cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;position:relative;';
      btn.onmouseover=()=>btn.style.backgroundColor='#f0f0f0';
      btn.onmouseout=()=>btn.style.backgroundColor='white';
      btn.onclick=(e)=>{e.preventDefault();clickHandler();};
      const img=document.createElement('img');
      img.src=imgSrc;
      img.alt=imgAlt;
      img.style.cssText='width:1.5rem;height:1.5rem;object-fit:contain;pointer-events:none;';
      btn.appendChild(img);
      addTooltipEvents(btn);
      return btn;
    }
    
    // BASE64 images:
    const imgPromptDir = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAD/UExURenp6c7OzrKysnl5eVZWVpOTkwAAAAEBAaGhoW1tbQMDA5ycnI2NjVtbW8bGxsjIyMrKyrGxscXFxd3d3dLS0ubm5ujo6IuLi3d3d+Li4uTk5E1NTezs7CYmJicnJ1BQUI6OjtXV1ZKSknZ2dpqamgICAt/f36ampnJyclxcXDk5OaqqqrCwsK+vr7+/v66urnR0dMPDw29vb+7u7rW1tSwsLIWFhUJCQkRERMTExNTU1AYGBsfHx3FxcWtra8nJybOzswQEBE5OTjMzM6mpqa2trdzc3OXl5UxMTKWlpUtLS52dnUlJSZ6enuPj40hISMvLy0ZGRqSkpOvr6wAAAKVmCqgAAABVdFJOU////////////////////////////////////////////////////////////////////////////////////////////////////////////////wCwoQfPAAAACXBIWXMAAA7BAAAOwQG4kWvtAAAAGHRFWHRTb2Z0d2FyZQBQYWludC5ORVQgNS4xLjgbaeqoAAAAtmVYSWZJSSoACAAAAAUAGgEFAAEAAABKAAAAGwEFAAEAAABSAAAAKAEDAAEAAAACAAAAMQECABAAAABaAAAAaYcEAAEAAABqAAAAAAAAANl2AQDoAwAA2XYBAOgDAABQYWludC5ORVQgNS4xLjgAAwAAkAcABAAAADAyMzABoAMAAQAAAAEAAAAFoAQAAQAAAJQAAAAAAAAAAgABAAIABAAAAFI5OAACAAcABAAAADAxMDAAAAAA5X1phWJRlb4AAAFhSURBVEhL5ZRXV8JAEIUpurEiorGAHdGIxoYo9i5WbPP/f4uzmZFkl6xsXuV7yHLP3C9kYU9SkJh/rqTSmWyfQponRKfSLxBHXtoM8IjoUAa5PxSUHUeGYZ4RujLCXSFGc2P5cVwz+cIEDwlNmaS6JIvRxXWKJiGaMh3uYgbjLK5FmoRoSonqEktlbp7qEltlgeoS2wdbpLrEVllKvv1lqktsFVhp/5XWCpR/D5i9AquBUEmiwNq6t1FN9C0Bm8mVreSK36vKtievO0Ls4mKl7AmxXwM4qFcPMRWPGg2XBiGacoy3FSccDKhKQRp5DiYUxcpQlBwKpwUOZiLKmTzy9bJ3Hs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pdvjlKoq9n5QBXNeKgAt0CzDq2Ekgvq6VCm74zRr/shDpi/dX2IVwDnEMB/yt8ImbsXsRbqs0O5iT5ZB5CrmS/gyn4A7k6wHDPHyFR/6W5+3CVZUGaIajkMcO3bgS5FzHIiziBvJHOU1lfID3OjfyxQ+nmPZne7CU1ObsH5BzbGJaqBf2qbTIBGxUaRG2UCYwJ94CT+C4v1UZfDBcV2mAfshrTXo5qEdHH/uCboUsZszfiuanIghbmQsQ0oRWUmxYTAGW9kdbFpELoorJTRGGcsXkrghDGzyE13CNHzgcjrzied8Om+958SArgwAAAABJRU5ErkJggg==';
    
    // כפתורים:
    const dirBtn = makeButtonImage('direction-toggle-button', textareaDirection==='rtl'?'כיוון כתיבה מימין לשמאל - Ctrl+Shift':'כיוון כתיבה משמאל לימין - Ctrl+Shift', imgPromptDir, 'כיוון כתיבה', toggleDirection);
    dirBtn.querySelector('img').style.transform = textareaDirection === "ltr" ? "scaleX(-1)" : "scaleX(1)";
    
    const mdBtn = makeButtonImage('markdown-toggle-button', 'החלף כיוון כתיבה של התשובות', imgMarkdownDir, 'כיוון תשובות', toggleMarkdownDirection);
    
    const qBtn=document.createElement('button');
    qBtn.id='q-style-toggle-button';
    qBtn.title='הפעל/בטל עיצוב על whitespace-pre-wrap';
    qBtn.textContent='Q';
    qBtn.style.cssText=dirBtn.style.cssText;
    qBtn.onclick=(e)=>{e.preventDefault();toggleWhitespaceStyle();toggleQButtonGlow();};
    addTooltipEvents(qBtn);
    
    const nextBtn=makeButtonImage('next-snir-button','קפוץ לשאלה הבאה - Alt+↓',imgNextBtn,'קפוץ לשאלה הבאה',jumpToNext);
    const prevBtn=makeButtonImage('prev-snir-button','קפוץ לשאלה הקודמת - Alt+↑',imgPrevBtn,'קפוץ לשאלה הקודמת',jumpToPrevious);
    
    // יצירת כפתורים
    function createButtons(){
      if(document.querySelector('#direction-toggle-button')) return;
    
      const textarea=document.querySelector('#prompt-textarea');
      const buttonContainer=textarea?.closest('form')?.querySelector('div.flex > div.flex');
      if(!textarea||!buttonContainer) return;
    
      let btnGroup=document.querySelector('#custom-btn-group');
      if(!btnGroup){
        btnGroup=document.createElement('div');
        btnGroup.id='custom-btn-group';
        btnGroup.style.cssText='position:absolute;bottom:13px;right:95px;display:flex;gap:10px;z-index:9999;';
        buttonContainer.style.position='relative';
        buttonContainer.appendChild(btnGroup);
      }
    
      btnGroup.appendChild(prevBtn);
      btnGroup.appendChild(nextBtn);
      btnGroup.appendChild(mdBtn);
      btnGroup.appendChild(dirBtn);
    
      // החלת כיוון כתיבה מה־localStorage
      if (textarea) {
        textarea.style.direction = textareaDirection;
        const img = dirBtn.querySelector('img');
        if (img) img.style.transform = textareaDirection === 'ltr' ? 'scaleX(-1)' : 'scaleX(1)';
      }
    }
    
    document.addEventListener('keydown', function (e) {
      if (e.key === 'ArrowUp' && e.altKey) {
        e.preventDefault();
        jumpToPrevious();
      }
      if (e.key === 'ArrowDown' && e.altKey) {
        e.preventDefault();
        jumpToNext();
      }
      if(e.ctrlKey && e.shiftKey && !e.altKey) {
        e.preventDefault();
        toggleDirection();
      }
    });
    
    const observer=new MutationObserver(()=>{createButtons();});
    observer.observe(document.body,{childList:true,subtree:true});
    createButtons();
    })();
        
    
    
    לחץ כאן כדי להעתיק את הקוד
  3. שמור את התמונה הבאה בשם icon.png 

    התוסף מוכן, כעת נפעיל אותו ע"י הדפדפן:
  1. פתח את Chrome.
  2. :עבור לכתובת
  3. הפעל את Developer mode (בצד ימין למעלה).
  4. לחץ על Load unpacked ובחר את התיקייה עם הקבצים שלך.

יום שלישי, 16 ביולי 2024

c# החלפת משתמש בווינדוס / נעילת המחשב


[DllImport("user32.dll")]
public static extern void LockWorkStation();

// The function to switch user/lock the computer
void foo() { LockWorkStation(); } 
  

יום חמישי, 11 באפריל 2024

merge multiple docx

 בשביל לחבר קבצי docx צריך להוסיף reference לקבצים הבאים:

חלון Solution Explorer > לחיצה ימנית על References > לחיצה על Add References

להוריד NuGet או מהאינטרנט את הקבצים ולהוסיף:

Telerik.Windows.Documents.Flow.dll

קוד C#:

void MergeDocx(List<string> files, string result_file)
{
   RadFlowDocument target = new RadFlowDocument();
   RadFlowDocument source = new RadFlowDocument();
   DocxFormatProvider provider = new DocxFormatProvider();
   for (int i = 0; i < file.Count; i++)
  {
     using(Stream input = File.OpenRead(files[i]))
     {
          target.Merge(provider.Import(input));
      }
   }
   byte[] ba = provider.Export(target);
   File.WriteAllBytes(result_file, ba);
 }

convert docx to pdf telerik

 בשביל להמיר docx ל-pdf צריך להוסיף reference לקבצים הבאים:

חלון Solution Explorer > לחיצה ימנית על References > לחיצה על Add References

להוריד NuGet או מהאינטרנט את הקבצים ולהוסיף:

Telerik.Windows.Documents.Core.dll
Telerik.Windows.Documents.Flow.dll
Telerik.Windows.Documents.Flow.FormatProviders.Pdf.dll

קוד C#:

void ConvertDocxToPdf(string docxpath, string pdfpath)
{
  var docxProvider = new DocxFormatProvider();
  var pdfProvider = new PdfFormatProvider();
  byte[] docxByteArr = File.ReadAllBytes(docxpath);
  var doc = docxProvider.Import(docxByteArr);
  byte[] resultPdfByteArr = pdfProvider.Export(doc);
  File.WriteAllBytes(pdfpath, resultPdfByteArr);
}

יום שני, 12 ביוני 2023

Search in list

חיפוש מחרוזת תווים בתוך מאגר מילים: - מיושם בתוכנת C# Winform:
List<string> listTemp = new List<string>();
private void textBox1_TextChanged(object sender, EventArgs e)
{
  var tmp = new List<string>();
  
  //restore source list
  if (textBox1.Text.Length == 0 || textBox1.Text.Length > 1)
    richTextBox1.Text = String.Join(" ", listTemp);
  
  if (textBox1.Text.Length > 0)
  {
    //copy from src to out-temp (happens only once)
    if (textBox1.text.Length == 1 && listTemp.Count == 0)
      listTemp = richTextBox1.Text.Split(' ').ToList();
  
    //filter
    foreach (string item in richTextBox1.Text.Split(' ').ToList())
    {
      if (item.Contains((textBox1.text))
        tmp.Add(item);
    }
    richTextBox1.Text = String.Join(" ", tmp);
  }
}

private void richTextBox1_TextChanged(object sender, EventArgs e)
{
  if (richTextBox1.Focused)
    listTemp.Clear();
}

יום שני, 28 בנובמבר 2022

WPF - בחירת עמודות מטופס חיצוני - Column Chooser

בשביל שימוש בפקדים של telerik צריך להוסיף ref לקבצים:

Telerik.Windows.Controls
Telerik.Windows.Controls.GridView
Telerik.Windows.Controls.Input
Telerik.Windows.Data

  https://www.telerik.com/blogs/how-to-column-chooser-for-radgridview-for-silverlight-and-wpf

MainWindow.xaml

MainWindowxaml.cs

dummy class

VisisbilityToBoolConverter

ColumnChooser xaml page

ColumnChooser xaml.cs page

יום שני, 16 במאי 2022

הורדה ישירה מחנות מיקרוסופט

1. צריך למצוא את האפליקציה שרוצים להוריד, ולהעתיק את id שלה. 
למשל עבור WinDbg Preview   הכתובת היא:
https://apps.microsoft.com/store/detail/windbg-preview/9PGJGD53TN86
הקוד הוא 9PGJGD53TN86

2. ללכת לאתר: https://store.rg-adguard.net   לבחור ברשימה הנפתחת את product id להזין שם הקוד שהעתקנו,וללחוץ v. 
כמה שניות והכתובות יופיעו. 

 3. צריך להוריד קובץ appx

4. ע"פ אתר https://github.com/MicrosoftFeedback/WinDbg-Feedback/issues/19       צריך לעשות לקובץ unzip לתוך תיקיה ולהריץ את קובץ DbgX.Shell.exe 

5. ע"פ אתר https://digitalitskills.com   צריך להריץ PowerShell ולהתקין:
PS C:\WINDOWS\System32\Add-AppxPackage -Path C:\windbg.appx