anonymous No title
JavaScript
  let gameTabs = document.getElementsByClassName('gameTab');
  for (var i = 0; i < gameTabs.length; i++) {
    gameTabs[i].onclick = function() {
      console.log(this.innerText);
      if(this.innerHTML.match(/スプレッド/)){
        set_onclick();
        aws_send_message(this.innerText + 'スプレッド');
      } else {
        set_onclick();
        aws_send_message(this.innerText);
      }
    };
  }
anonymous No title
JavaScript
<html>
<head>
    <style> 
    textarea{border:none;}
    textarea{width: 600px;}
    textarea{height: 600px;}
    textarea{resize: none;}
    </style>
</head> 
<body>
 
<script type="text/javascript">
myMsg = "1988年に北海道壮瞥町で公式ルールが定められ、毎年2月に同町の昭和新山の麓で国際大会が行われている、7人ずつの2チームの競技者が互いに雪玉をぶつけ合うウィンタースポーツは何でしょう?";
myCnt = 0;
function myFunc(){
     document.myForm.myFormMes.value = myMsg.substring( 0 , myCnt ) + "_";
     myCnt = myCnt + 1;
}
</script>
<form name="myForm" style="resize:none;">
    <textarea  type="text" size="500" name="myFormMes" >
    </textarea>
</form>
<script type="text/javascript">
setInterval("myFunc()",200);
</script>
 
 </body>
</html>
anonymous No title
JavaScript
<html>
 <body>
 
<script type="text/javascript">
myMsg = "{{表面}}";
myCnt = 0;
function myFunc(){
     document.myForm.myFormMes.value = myMsg.substring( 0 , myCnt ) + "_";
     myCnt = myCnt + 1;
}
</script>
<form name="myForm"  >
    <input type="text" size="50" name="myFormMes" style="border:none" style="max-width:600px">
    </form>
<script type="text/javascript">
setInterval("myFunc()",200);
</script>
 
 </body>
</html>
anonymous No title
JavaScript
<html>
 <body>
 
<script type="text/javascript">
myMsg = "{{表面}}";
myCnt = 0;
function myFunc(){
     document.myForm.myFormMes.value = myMsg.substring( 0 , myCnt ) + "_";
     myCnt = myCnt + 1;
}
</SCRIPT>
<form name="myForm">
    <input type="text" size="500" name="myFormMes" style="border:none">
    </form>
<script type="text/javascript"><!--
setInterval("myFunc()",200);
</script>
 
 </body>
</html>
anonymous No title
JavaScript
<html>
 <body>
 
<script type="text/javascript">
myMsg = "{{表面}}";
myCnt = 0;

function myFunc(){
     document.myForm.myFormMes.value = myMsg.substring( 0 , myCnt ) + "_";
     myCnt = myCnt + 1;
}
</SCRIPT>

<form name="myForm">
<input type="text" size="500" name="myFormMes">
</form>
<script type="text/javascript"><!--
setInterval("myFunc()",200);
</script>
 
 </body>
</html>
anonymous YoutubeをDLできるやーつ
JavaScript
// コンソールに貼り付けて動画をシークすると…?
(function() {
  const downloaded = {};
  const origin = new URL([...document.head.getElementsByTagName('link')]
    .find(v => v.rel === 'preload' && v.href.indexOf('googlevideo') !== -1).href)
    .origin;
  const title = [...document.body.getElementsByTagName('meta')]
    .find(v => v.name === 'title')
    .content;

  function parseURL(url) {
    if (url.indexOf('videoplayback') === -1) return null;
    const range = url.match(/range=(\d+)-(\d+)/);
    return {
      type: url.indexOf('mime=video') !== -1 ? 'video' : 'audio',
      start: Number(range[1]),
      end: Number(range[2]),
    };
  }

  function stripRange(url) {
    return url.replace(/&range=\d+-\d+/, '');
  }

  function downloadLink(name, link) {
    const a = document.createElement('a');
    a.href = link;
    a.download = name;
    a.textContent = name;

    const player = document.body.getElementsByTagName('ytd-video-primary-info-renderer')[0];
    player.parentNode.insertBefore(document.createElement('br'), player);
    player.parentNode.insertBefore(a, player);
    console.log(a);
  }
  
  var origOpen = XMLHttpRequest.prototype.open;
  XMLHttpRequest.prototype.open = function(method, url) {
      const meta = parseURL(url);
      if (meta !== null) {
        this.addEventListener('load', function() {
          const mime = this.getResponseHeader('Content-Type');
          const match = mime.match(/(video|audio)\/(webm|mp4)/);
          if (match) {
            if (downloaded[meta.type] === undefined) {
              downloaded[meta.type] = true;
              downloadLink(`${title}.${meta.type[0]}.${match[2]}`, stripRange(url));
            }
          }
        });
      }
      origOpen.apply(this, arguments);
  };
})();

anonymous No title
JavaScript
function() {
  var _ret = document.querySelector('[data-checkout-payment-due-target]').dataset.checkoutPaymentDueTarget;
  if(_ret === undefined){
  	return _ret;
  }
  else{
  	return _ret / 100;
  }

}
anonymous FizzBuzz
JavaScript
(卑=猥=>猥?卑(猥-1).concat(((猥%3?'':'Fizz')+(猥%5?'':'Buzz'))||猥):[])(100).join(',')
itizawa No title
JavaScript
function submitFormHandler() {
    Swal.fire({
      title: 'Trivia を作成中します',
      icon: 'info',
      confirmButtonText: 'いますぐ知識を発信する',
      preConfirm: () => {
        Swal.showLoading();
        Swal.update({ showConfirmButton: false });
        try {
          return apiPost('/trivias', {
            forwardText, backwardText, tags, genre, bodyText,
          });
        }
        catch (err) {
          Swal.fire({
            icon: 'error',
            title: 'エラーが発生しています!',
            text: `${err}`,
            showConfirmButton: false,
            showCancelButton: true,
            cancelButtonText: '閉じる',
          });
        }
      },
    }).then((result) => {
      // 作成ボタンを押して、エラーが発生しなかった時
      if (result.isConfirmed) {
        Swal.fire({
          icon: 'success',
          title: '作成完了 !',
          html: '一覧ページに戻ります',
          timer: 2000,
          timerProgressBar: true,
        }).then(() => {
          Router.push('/list');
        });
      }
    });
  }
anonymous sweet alert を使ってエラーハンドリング
MIT JavaScript
    Swal.fire({
      title: 'Trivia を削除しますか?',
      text: '一度消した Trivia は元には戻せません。',
      icon: 'warning',
      showCancelButton: true,
      confirmButtonColor: '#d33',
      confirmButtonText: '削除する!',
      preConfirm: async() => {
        try {
          await apiDelete(`/trivias/${props.triviaId}`);
          Router.push('/list');
        }
        catch (err) {
          Swal.showValidationMessage(
            `トリビア削除中にエラーが発生しました<br>${err.message}`,
          );
        }
      },
    });
Don't you submit code?
Submit