This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const stateA = { foo: "bar" }; | |
| const stateB = stateA; | |
| stateB["hoge"] = "huga"; // stateAに対する破壊的変更 | |
| console.log("stateA: ", stateA); // stateAが更新されている | |
| // コピーしたいならこうする | |
| const correctStateA = { foo: "bar" }; | |
| const correctStateB = { ...correctStateA }; // 浅いコピー | |
| correctStateB["hoge"] = "huga"; // correctStateAには影響が出ない | |
| console.log("correctStateA: ", correctStateA); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import os | |
| import subprocess | |
| import sys | |
| from selenium import webdriver | |
| from selenium.webdriver.chrome.options import Options | |
| from selenium.webdriver.common.by import By | |
| from selenium.webdriver.common.keys import Keys | |
| from selenium.webdriver.support import expected_conditions as EC | |
| from selenium.webdriver.support.ui import WebDriverWait |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env raku | |
| my IO::Path $commit-editmsg-path = IO::Path.new(@*ARGS[0]); | |
| my IO::Path $project-root-path; | |
| if !$commit-editmsg-path.is-absolute { | |
| $project-root-path = IO::Path.new((run 'git', 'rev-parse', '--show-toplevel', :out).out.slurp(:close).trim); | |
| } | |
| my Str $commit-msg = slurp($commit-editmsg-path.absolute($project-root-path)); | |
| my Str @prefixs = [ | |
| 'Merge ', | |
| 'added: ', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| BEGIN { | |
| FS = "," | |
| OFS = "," | |
| print "姓1,名1,敬称1,姓2,名2,敬称2,姓3,名3,敬称3,姓4,名4,敬称4,姓5,名5,敬称5,姓6,名6,敬称6,〒番号,住所1,住所2,住所3,会社名,部署,役職,御中" | |
| } | |
| NR > 1 { | |
| print $1, $2, $20, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", $7, $8 $9 $10, $11, "", $12 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [@react.component] | |
| let make = () => { | |
| let (todos, setTodos) = React.useState(() => []); | |
| let (inputCurrent, setInputCurrent) = React.useState(() => ""); | |
| <div> | |
| <ol> | |
| { | |
| List.map(todo => <li> {React.string(todo)} </li>, todos) | |
| |> Array.of_list | |
| |> React.array |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ========================== KeySnail Init File =========================== // | |
| // この領域は, GUI により設定ファイルを生成した際にも引き継がれます | |
| // 特殊キー, キーバインド定義, フック, ブラックリスト以外のコードは, この中に書くようにして下さい | |
| // ========================================================================= // | |
| //{{%PRESERVE% | |
| plugins.options["hok.hint_keys"] = "htnsdcrbmwvz"; | |
| plugins.options["hok.hint_base_style"] = { | |
| "font-family": "monospace", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| input { | |
| display: none; | |
| } | |
| label { | |
| display: none; | |
| } | |
| #pitchStart { | |
| color: #ff4500; | |
| background-color: #7cfc00; | |
| width: 10vw; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE OverloadedStrings #-} | |
| {-# LANGUAGE QuasiQuotes #-} | |
| import Text.Blaze.Html.Renderer.Pretty (renderHtml) | |
| import Text.Hamlet | |
| data MyRoute = Home | |
| render :: Render MyRoute | |
| render Home _ = "/home" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <algorithm> | |
| #include <cassert> | |
| #include <iostream> | |
| #include <random> | |
| #include <vector> | |
| template <class RandomAccessIterator> | |
| void quick_sort(RandomAccessIterator begin, RandomAccessIterator end) { | |
| // 要素数0, 1の場合 | |
| if (begin == end || begin + 1 == end) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fn main() { | |
| let mut s = String::new(); | |
| for i in 1..600000 { | |
| if i % 3 == 0 && i % 5 == 0 { | |
| s += "FizzBuzz\n"; | |
| } else if i % 3 == 0 { | |
| s += "Fizz\n"; | |
| } else if i % 5 == 0 { | |
| s += "Buzz\n"; | |
| } else { |