Skip to content

Instantly share code, notes, and snippets.

View DriftwoodJP's full-sized avatar

DriftwoodJP DriftwoodJP

View GitHub Profile
@celian-rib
celian-rib / useScrollBlock.ts
Last active May 24, 2024 08:54 — forked from reecelucas/useScrollBlock.js
React hook to enable/disable page scroll (Typescript version)
import { useRef } from 'react';
const safeDocument: Document = document;
/**
* Usage:
* const [blockScroll, allowScroll] = useScrollBlock();
*/
export const useScrollBlock = (): [() => void, () => void] => {
const scrollBlocked = useRef(false);
@reecelucas
reecelucas / useScrollBlock.js
Last active July 18, 2024 15:01
React hook to enable/disable page scroll
import { useRef } from 'react';
const safeDocument = typeof document !== 'undefined' ? document : {};
/**
* Usage:
* const [blockScroll, allowScroll] = useScrollBlock();
*/
export default () => {
const scrollBlocked = useRef();
@mizchi
mizchi / predict-frontend.md
Last active May 12, 2023 03:43
React のユーザーから見た今後のフロントエンドの予想

この記事は議論のたたき台で、ポジショントークや、偏見にまみれています。

今のフロントエンドの分類

  • 古典的なサーバーサイド WAF への +α の味付け
  • 大規模なクライアントアプリケーション管理のための SPA
  • SEO / SSR を考慮した Node ヘヴィーな環境

他、提唱されてるパターン

.flex {
display: flex;
.align-center {
margin: auto;
align-self: center;
}
.align-left {
margin-right: auto;
@tunguskha
tunguskha / Gradient shadow in pure CSS.md
Last active May 4, 2023 06:40
Gradient shadow in pure CSS

Gradient shadow in pure CSS

alt text

HTML
<button>Let's Go !</button>
@anschaef
anschaef / bootstrap-4-sass-mixins-cheat-sheet.scss
Last active April 12, 2024 08:49
Bootstrap 4 Sass Mixins [Cheat sheet with examples]
/* -------------------------------------------------------------------------- */
// All Bootstrap 4 Sass Mixins [Cheat sheet]
// Updated to Bootstrap v4.5.x
// @author https://anschaef.de
// @see https://github.com/twbs/bootstrap/tree/master/scss/mixins
/* -------------------------------------------------------------------------- */
/*
// ########################################################################## */
// New cheat sheet for Bootstrap 5:
@lukas-h
lukas-h / license-badges.md
Last active July 27, 2024 13:38
Markdown License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • The badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.

Translations: (No guarantee that the translations are up-to-date)

@azu
azu / js.md
Last active June 23, 2024 17:38
JavaScriptのレベル別書籍のまとめ

前提: 完成していて、比較的支持を集めていて、JavaScriptを中心にした書籍 (DOM APIよりは言語を中心とした内容)

追記: JavaScriptの入門書 #jsprimerを書いている

最初からES2015で学ぶことを前提にした初心者〜中級者向けのJavaScript本がなかったので書いてる。 ES2015でJavaScriptという言語のコア部分は大きく変わったので、それを前提とした内容にする予定。

@bdsexton
bdsexton / csv-trees.md
Last active July 25, 2022 03:50
Generate File System Trees in CSV Format with "tree" and "sed"

Generate File System Trees in CSV Format with "tree" and "sed"

Description

I don't know whether this will be useful to anyone else, but I wanted to use the Linux tree command to generate file system trees in CSV format on OS X. This should work pretty much as is on Linux, although you may need or want to change the paths and optimize the usage of sed.

Dependency

This uses the Linux "tree" command, which is not standard on OS X.

<?php
$args = array(
// ↓ 特定の「著者」に関連付けられた投稿を表示する場合
'author' => '1,2,3', // 著者IDを指定
'author_name' => 'solecolor', // user_nicenameを指定(名前ではありません)
'author__in' => array( 2 , 6 ), // 著者IDを配列で指定(著者IDを含む記事を絞り込む)
'author__not_in' => array( 2 , 6 ), // 著者IDを配列で指定(著者IDを含まない記事を絞り込む)
// ↓ 特定の「カテゴリー」に関連付けられた投稿を表示する場合
'cat' => 5, // カテゴリーIDを指定