-
【CSS】Flexboxで横スクロール
CSS
.parent_element { overflow-x: scroll; display: flex; } .children_elements { min-width: xxxpx; } .children_elements { flex-shrink: 0; } -
Swiperの使い方
JavaScript
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css" /> <script src="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js"></script> <!-- Slider main container --> <div class="s... -
【Python】配列から重複している要素を削除する
Python
t = [1, 2, 3, 4, 5] re = [2, 4] [t.remove(r) for r in re if r in t] print(t) # [1, 3, 5] -
【Live SaSS Compiler】SCSSの出力先を変更する
Visual Studio Code
scssファイルはscssフォルダ、cssファイルはscssフォルダと同階層にあるcssフォルダに出力したい時 "liveSassCompile.settings.formats": [ { "format": "expanded", "extensionName": ".css", "savePath": "~/../css", // 「/css」のみだとプロジェク... -
【Python】2つの配列から重複している要素を取得する
Python
one = [1, 2] two = [2, 3] print(set(one) & set(three)) # {2} -
【Python】配列に重複している要素があるか確認する
Python
one = [1, 2] two = [2, 3] three = [4, 5] print(set(one).isdisjoint(two)) # False print(set(two).isdisjoint(three)) # True 参考:https://docs.python.org/ja/3/library/stdtypes.html -
【MySQL】結果の行数をカウントする
MySQL
SELECT COUNT(*) FROM table_name WHERE column_name = "xxx"; 参考:https://dev.mysql.com/doc/refman/8.0/ja/counting-rows.html -
【Python】配列の重複している要素を削除する
Python
number = [1, 2, 3, 4, 5, 5, 6] print(list(set(number))) # [1, 2, 3, 4, 5, 6] 参考:https://docs.python.org/ja/3/c-api/set.html -
【Python】配列を比較し含まれていない要素を抽出
Python
number = [1, 2, 3, 4, 5] odd = [1, 3, 5] even = [2, 4] print(list(set(number) - set(odd))) # [2, 4] print(list(set(number) - set(even))) # [1, 3, 5] print(list(set(odd) - set(even))) # [1, 3, 5] 参考:https://docs... -
【JavaScript】HTMLを挿入する
JavaScript
let h = document.querySelector("#xxx"); h.append(this.responseText); // HTMLが文字列として出力される let h = document.querySelector("#xxx"); h.insertAdjacentHTML("afterbegin", this.responseText); 参考:https://developer.mozilla.org/ja/do...