Skip to content

Instantly share code, notes, and snippets.

View nakajmg's full-sized avatar

Naohiro Nakajima nakajmg

View GitHub Profile
Seven different types of CSS attribute selectors
// This attribute exists on the element
[value]
// This attribute has a specific value of cool
[value='cool']
// This attribute value contains the word cool somewhere in it
[value*='cool']
@kenmori
kenmori / TypeScriptPractice.md
Last active May 19, 2024 01:52
TypeScript 練習問題集
@paulirish
paulirish / what-forces-layout.md
Last active July 29, 2024 19:02
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@gunyarakun
gunyarakun / README.md
Last active September 26, 2022 18:21
旺文社『表現のための実践ロイヤル英文法』別冊付録「英作文のための暗記用例文300」JSON

Japanese translation from the original post in English.

原文: [Getting Literal With ES6 Template Strings by Addy Osmani] (http://updates.html5rocks.com/2015/01/ES6-Template-Strings)

#ES6のテンプレート文字列

従来のJavaScriptの文字列処理はPythonやRubyに比べて非力でしたが、ES6のテンプレート文字列はこの状況を根本的に覆します。(テンプレート文字列はChrome 41からサポートされています。)それによりプログラマはドメイン固有言語(domain-specific language、DSL)を定義する事が可能になります。以下はテンプレート文字列が提供する機能です。

  • 文字列の挿入
  • 式を文字列に埋め込む
@teppeis
teppeis / gist:c50743a60832560aa1df
Last active April 29, 2023 15:04
Break the Web: Object staticメソッドがES6で仕様変更になった件について

Break the Web: Object static methods no longer throw errors for primitives!

Object.keys等のstaticメソッドがES6で挙動が変わったことで面倒なことになってる話

何が変わったか

ES5でプリミティブを受け取ると例外を投げていたObject.keys等のメソッドが、ES6では例外を吐かなくなった。

  • Object.getPrototypeOf ( O )
  • Object.getOwnPropertyDescriptor ( O, P )
@jasesmith
jasesmith / AtomVerticalTabs.md
Last active November 23, 2019 09:40
Vertical file tab list in Atom

Vertical File Tabs in Atom

Add the styles to the .atom/styles.less stylesheet in Atom.

Atom Vertical File Tabs

@geckotang
geckotang / color.js
Last active August 29, 2015 14:07 — forked from kubosho/color.js
var $box = $('#box'), $panels, $panel, f, i;
function exec() {
for (i=0; i<$panels.length; i++){
$panel = $($panels[i]);
if ($panel.data('type') === 'a') {
$panel.click();
return true;
}
}
@uupaa
uupaa / MobileSafari.ChangeLog.md
Last active August 29, 2015 14:01
Mobile Safari ChangeLog

iOS 5 MobileSafari

  • Web Workers が実装されました
  • XMLHttpRequest Lv2 が実装されました
  • CSS Position: fixed が実装されました
  • Appnize(Homeに追加)したページでもJITが有効になりました
  • <meter>, <detail>, <summary> が実装されました
  • <input type="..."> が range, date, time, datetime, month, datetime-local をサポートしました
  • Inline SVG をサポートしました
  • Token List API を実装しました。 body.classList.add("CSS-CLASS-NAME") が可能になりました
@koba04
koba04 / api.md
Last active July 19, 2021 10:49
Vue.js note(v0.10.3). not translate. This is draft of https://github.com/koba04/vuejs-book .

API

Class: Vue

  • Vueはvue.jsのコアとなるコンストラクタ
  • インスタンスが作られたときにデータバインディングが開始される
  • オプションを取ることも出来て、DOMやデータやメソッドについて定義出来る