anonymous Stravaの画面上のKudosを一括で押すブックマークレット
JavaScript
javascript:!function(c,b,a){a=c.createElement("script");a.src="//j.mp/1bPoAXq";a.onload=function(){b(jQuery.noConflict(1))};c.body.appendChild(a)}(document,function(b){var a = b(".btn-kudo.js-add-kudo");a.click();});
anonymous No title
JavaScript
const input = [
  { level: 1, text: "1章 JavaScriptの第一歩" },
  { level: 1, text: "2章 データ型と変数" },
  { level: 2, text: "2.1 変数の識別" },
  { level: 2, text: "2.2 スコープ" },
  { level: 1, text: "第3章 演算子と文" },
  { level: 2, text: "3.1 文の形式" },
  { level: 2, text: "3.2 単純文" },
  { level: 3, text: "3.2.1 代入文" },
  { level: 3, text: "3.2.2 演算文" },
];

function treefy(input) {
  const output = [];
  const containers = [output];
  let level = 1;

  for (let i = 0; i < input.length; i++) {
    const item = input[i];

    if (item.level > level) {
      input[i-1].children = [item];
      containers.push(input[i-1].children);
    } else if (item.level < level) {
      containers.pop();
    }
    
    containers[containers.length-1].push(item);
    level = item.level;
  }

  return output;
}

console.log(
  JSON.stringify(treefy(input), null, '\t')
);
anonymous No title
JavaScript
<!DOCTYPE html>
<html lang="ja">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script type="text/javascript">
    
    for (let n=1; n<=100  ;n++)
   {
        if (n % 15 == 0){
            document.write("FizzBuzz" + "<br>" );
        }
            else if(n % 5 == 0){
                document.write("Buzz" + "<br>" );
            }
            else if(n % 3 == 0){
                document.write("Fizz" + "<br>" );
            }

        else {
        document.write(n  + "<br>" );
        }
   }
        //document.write("FizzBuzz");
    </script>
</body>
</html>
anonymous No title
JavaScript
console.log("a");
anonymous No title
JavaScript
  useEffect(() => {
    if (typeof window !== 'undefined') {
      window.addEventListener('focus', readClipboardText);
    }
    return () => {
      if (typeof window !== 'undefined') {
        window.removeEventListener('focus', readClipboardText);
      }
    };
  }, [window]);
anonymous <p></p>
JavaScript
does it rate limit?
anonymous <p></p>
JavaScript
does it rate limit?
anonymous <p></p>
JavaScript
does it rate limit?
anonymous <p></p>
JavaScript
does it rate limit?
anonymous <p></p>
JavaScript
does it rate limit?
Don't you submit code?
Submit