Skip to content

Instantly share code, notes, and snippets.

// jsonschema
export type JSONSchema$Type$Base = {
id?: string,
required?: boolean
}
export type JSONSchema$Type$Object = JSONSchema$Type$Base & {
type: 'object',
properties: {[key: string]: JSONSchema$Type},
additionalProperties?: false,
npm i -g nativefier
curl https://azu.github.io/in-site-search-javascript/index.js > index.js
nativefier --name "ECMAScript" "https://tc39.github.io/ecma262/" --fast-quit --hide-window-frame --show-menu-bar --maximize --inject ./index.js
@mizchi
mizchi / gen-pkg.js
Last active February 19, 2017 07:41
Create inner package by yaml
#!/usr/bin/env node
/* eslint-disable */
/*
Usage.
: Input generator.yml
pkgName: '@x/y'
testExtension: .test.js

WIP某所で喋るための草稿。

Testable JavaScript

当たり前のことを書く。当たり前のことが、当たり前にできない人へ。JavaScriptだから、当たり前のことをしなくていいと思っている人達へ。

基本方針

  • それぞれのファイルは、可能な限り参照透過な関数を提供する
  • それぞれのファイルは、読み込んだだけでは副作用を起こさない
var str = 'class ಠ_ಠ extends Array {constructor(j = "a", ...c) {const q = (({u: e}) => {return { [`s${c}`]: Symbol(j) };})({});super(j, q, ...c);}}' +
'new Promise((f) => {const a = function* (){return "\u{20BB7}".match(/./u)[0].length === 2 || true;};for (let vre of a()) {' +
'const [uw, as, he, re] = [new Set(), new WeakSet(), new Map(), new WeakMap()];break;}f(new Proxy({}, {get: (han, h) => h in han ? han[h] ' +
': "42".repeat(0o10)}));}).then(bi => new ಠ_ಠ(bi.rd));';
try {
eval(str);
} catch(e) {
alert('Your browser does not support ES6!')
}
@ryo33
ryo33 / ja.md
Last active June 4, 2018 06:56
ReduxでMiddlewareを使ってサクッと解決する

はじめに

これはredux-middlewaresの紹介です。

Middlewareについて

Middlewareがどのようなものかついては、非常に分かりやすい記事があるのでそれを貼っておきます。
http://qiita.com/kuy/items/57c6007f3b8a9b267a8e
僕がMiddlewareを活用するようになったのは、この記事を読んでからです。

@kenmori
kenmori / JavaScript.md
Last active August 27, 2026 09:40
JavaScript練習問題集(ECMAScript2015,2016,2017,2018,2019,2020, 2021, 2022, 2023, 2024, 2025, 2026, other Library)

JavaScript練習問題集

JavaScript

更新情報

・問題番号の重複を解消して全411問の連番に整理、空の問題を削除、「問」表記に統一(2026/8/27)
・ES2026、ES2025の問題を追加、誤記を修正(2026/8/27)
・constをletに修正、問題を追加(2024/9/27)
@leobalter
leobalter / karma.conf.js
Created November 12, 2015 23:01 — forked from frederickfogerty/karma.conf.js
Coverage + tests with webpack, babel, karma, mocha, and istanbul
var webpack = require('webpack')
module.exports = function (config) {
config.set({
browsers: [ 'Chrome' ], //run in Chrome
browserNoActivityTimeout: 60000,
singleRun: true, //just run once by default
frameworks: [ 'mocha' ], //use the mocha test framework
files: [
//'src/**/*.{jsx,js}',
@paulirish
paulirish / what-forces-layout.md
Last active August 24, 2026 13:06
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
@jonschlinkert
jonschlinkert / assemblefile.md
Last active February 8, 2024 08:26
How to create a project with Assemble v0.6.0

assemblefile.js

This is a fairly complete assemblefile

Shows how to:

  • load templates
  • use tasks with plugins
  • use middleware
  • register helpers