Skip to content

Instantly share code, notes, and snippets.

View yutahaga's full-sized avatar
🏠
Working from home

Yuta Haga yutahaga

🏠
Working from home
View GitHub Profile

明日の下書き


これはなに

  • 高円寺.dev #3 用の資料 https://koenji.connpass.com/event/160886/
  • フロントエンド専門じゃない人向けの、フロントエンドの最先端〜やや未来の話です
  • このレイヤーでは Node.js を使うべき/使うと強いという部分がありますが、他言語を否定しているわけではありません。むしろ他言語でこのアーキテクチャを模倣してほしいという話です。
@azu
azu / READ.md
Last active May 8, 2021 14:23
JavaScriptの本を書くときに参考にしてるもの

jsprimerというJavaScriptの書籍を書いている。 これを書いてるときに参考にしているものを書いていく。

ECMAScriptのLiving Standardな仕様書ページ。 スナップショットなECMAScriptの仕様書ページもあるけど、基本的にはLiving Standardの方しか見てない。

@mikowl
mikowl / oneliners.js
Last active March 28, 2024 20:52
👑 Awesome one-liners you might find useful while coding.
// Inspired by https://twitter.com/coderitual/status/1112297299307384833 and https://tapajyoti-bose.medium.com/7-killer-one-liners-in-javascript-33db6798f5bf
// Remove any duplicates from an array of primitives.
const unique = [...new Set(arr)]
// Sleep in async functions. Use: await sleep(2000).
const sleep = (ms) => (new Promise(resolve => setTimeout(resolve, ms)));
// or
const sleep = util.promisify(setTimeout);
@youkinjoh
youkinjoh / extendJSON.md
Last active March 9, 2022 07:37
JSONが対応していない値(NaN/Infinity/Date等)をJSONに保存する方法

JSONが対応していない値をJSONに保存する方法

JSONは NaN / Infinity / -InfinityDate 型等に対応していない。 しかし、JavaScriptのJSONは、これらを解消する仕組みを持っている。 それは JSON.parse の第二引数の reviverJSON.stringify の第二引数の replacer だ。

注意が必要なのは、 Date 型は toJSON メソッドを持つため replacer に値が渡る前に文字列になってしまうこと。 これに対応するには toJSON メソッドを一時退避してしまえば良い。

これらを上手く駆使すれば、JSONに型を保ったまま値を保存し復元することができる。

@nunomorgadinho
nunomorgadinho / gist:b2d8e5b8f5fec5b0ed946b24fa288a91
Created February 10, 2017 13:30
PHPCS + WordPress Coding Standards
# Install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install composer
brew install homebrew/php/composer
### PHPCS
composer global require "squizlabs/php_codesniffer=*"
# Add to your .bash_profile
@nownabe
nownabe / .commit_template
Created July 5, 2016 06:54
Emojiで楽しく綺麗なコミットを手に入れる
# ==== Emojis ====
# 🐛 :bug: バグ修正
# 👍 :+1: 機能改善
# ✨ :sparkles: 部分的な機能追加
# 🎉 :tada: 盛大に祝うべき大きな機能追加
# ♻️ :recycle: リファクタリング
# 🚿 :shower: 不要な機能・使われなくなった機能の削除
# 💚 :green_heart: テストやCIの修正・改善
@joehoyle
joehoyle / wp-api-batch.php
Last active March 7, 2024 02:13
Batch endpoint for the WP REST API
<?php
/**
* Plugin Name: WP REST API Batch Requests
* Description: Enabled a multi / batch requests endpoint for the WP RES API
* Author: Joe Hoyle
* Version: 1.0-alpha1
* Plugin URI: https://github.com/WP-API/WP-API
* License: GPL2+
*/
@JoostKiens
JoostKiens / functions.php
Last active April 22, 2019 09:58
Improve the WordPress caption shortcode with HTML5 figure & figcaption, microdata & wai-aria attributes
<?php
/**
* Improves the WordPress caption shortcode with HTML5 figure & figcaption, microdata & wai-aria attributes
*
* Author: @joostkiens
* Licensed under the MIT license
*
* @param string $val Empty
* @param array $attr Shortcode attributes
* @param string $content Shortcode content
@antsa
antsa / mq.scss
Last active March 2, 2019 16:41
Media Query mixin - @MQ
// A mixin for media queries: @mq
//
// Use with keywords in $medias array:
// @include mq($media: iphone) {
// ...
// }
//
// Use with manual queries:
// @include mq("all and (min-width:33em)") {
// ...