Skip to content

Instantly share code, notes, and snippets.

View Quramy's full-sized avatar
👾

Yosuke Kurami Quramy

👾
View GitHub Profile
@sindresorhus
sindresorhus / esm-package.md
Last active May 20, 2024 10:39
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@paulirish
paulirish / what-forces-layout.md
Last active May 20, 2024 06:33
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
@bsilver8192
bsilver8192 / BUILD
Created March 17, 2016 16:12
Basics of generating a compile_commands.json file with Bazel
py_binary(
name = 'generate_compile_command',
srcs = [
'generate_compile_command.py',
],
deps = [
'//third_party/bazel:extra_actions_proto_py',
],
)
@jakub-g
jakub-g / double-fetch-triple-fetch.md
Last active April 13, 2024 12:22
Will it double-fetch? Browser behavior with `module` / `nomodule` scripts
@matope
matope / NoSQLデータモデリング技法.markdown
Created April 16, 2012 03:35
NoSQLデータモデリング技法

#NoSQLデータモデリング技法

原文:NoSQL Data Modeling Techniques « Highly Scalable Blog

I translated this article for study. contact matope[dot]ono[gmail] if any problem.

NoSQLデータベースはスケーラビリティ、パフォーマンス、一貫性といった様々な非機能要件から比較される。NoSQLのこの側面は実践と理論の両面からよく研究されている。ある種の非機能特性はNoSQLを利用する主な動機であり、NoSQLシステムによく適用されるCAP定理がそうであるように分散システムの基本的原則だからだ。一方で、NoSQLデータモデリングはあまり研究されておらず、リレーショナルデータベースに見られるようなシステマティックな理論に欠けている。本稿で、私はデータモデリングの視点からのNoSQLシステムファミリーの短い比較といくつかの共通するモデリングテクニックの要約を解説したい。

本稿をレビューして文法を清書してくれたDaniel Kirkdorfferに感謝したいと思う

@renatodeleao
renatodeleao / figma-api-get-svg-via-images-endpoint.js
Last active September 14, 2023 17:04
Figma API — Get an svg node (via /images endpoint)
const ACCESS_TOKEN = "token";
const FILE_ID = "fileId";
const NODE_ID = "Check the url for something like => 3%3A2";
const container = document.getElementById("figma-container")
function apiRequest(url) {
return fetch(url, {
method: 'GET',
headers: { "x-figma-token": ACCESS_TOKEN }
}).then(function(response) {
@mattdesl
mattdesl / gist:10218005
Created April 9, 2014 01:45
pseudo-code for perlin-noise based generative impressionist paintings
render
for each particle
x, y = particle.position
color = sample( colorMap, x, y )
noise = sample( noiseMap, x, y )
angle = noise * PI * 2
particle.velocity.add( cos(angle), sin(angle) )
@yamacraft
yamacraft / Firebase-Admin-NodeJs.md
Last active January 4, 2023 10:28
node.jsからサービスアカウント使ってFirebaseへ接続する時のメモ

検索ワード:Firebase Auth サービスアカウント nodejs

(注意)日本語版の情報は既に少し古い

下準備

サービスアカウントの作成

  1. Firebaseコンソールサイト>歯車>権限 でGoogle APIコンソールっぽい管理画面へ。
  2. サービスアカウント>サービスアカウントを作成をクリックしてアカウントを作成
@faithandbrave
faithandbrave / emscripten_cmake_build.md
Last active October 11, 2022 05:08
EmscriptenとCMakeでのビルド方法

EmscriptenとCMakeでのビルド方法

Emscriptenは、C++をJavaScriptにコンパイルする、LLVMベースのコンパイラ。

このドキュメントでは、特定のプロジェクトに依存せず、Emscripten向けに、CMakeを使用してC++プロジェクトをビルドする方法を紹介する。

バージョン

このドキュメントで扱う各ツールのバージョンは、以下のものとする:

@dead-claudia
dead-claudia / constraint-types.md
Last active October 3, 2022 19:31
TypeScript Constraint Types Proposal

(All feedback/discussion should take place in the relevant issue.)

TypeScript Constraint Types Proposal

There's multiple requests for the ability to control a type at a much more fine grained level:

  • #12424: Mapped conditional types
  • #12885: Typing function overloads
  • #12880: Bad inference for lambda closures
  • Promises wrongfully accept thenables as their generic parameter (thenables can never be the argument to a then callback).