Skip to content

Instantly share code, notes, and snippets.

View sotayamashita's full-sized avatar
💭
May be slow to respond

Sam Yamashita sotayamashita

💭
May be slow to respond
View GitHub Profile
var _ = require("lodash");
var path = require("path");
var env = process.env.NODE_ENV || "development";
var debug = ["development", "test"].indexOf(env) !== -1;
var defaults = {
cache: debug,
debug: debug,
@sotayamashita
sotayamashita / on-jsx.markdown
Created October 20, 2015 06:18 — forked from chantastic/on-jsx.markdown
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I lead the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can'

const rootReducer = combineReducers({
  router
});
@sotayamashita
sotayamashita / es5to6.js
Created October 16, 2015 04:30
ES5 to 6
// http://qiita.com/inuscript/items/41168a50904242005271
// es5 require('')
@sotayamashita
sotayamashita / README.md
Last active October 30, 2015 09:22
💡 Scarable React, Redux and React CSS Modules directory structure

Note: It is written in Japanese 🇯🇵

React・Redux・React CSS Modulesを使用した際のどのようにすればスケールしやすく管理しやすくなるかについてまとめたものです。調べながらメモっているので何か間違いなどありましたコメントしていただければ幸いです。

分かりやすいように実際に自分が作ろうとしている GitHub のレポジトリを NAVER まとめのように自分でまとめるサービスを例に取りながらどのようにすれば良いのかについて理由とともにまとめます。

├── components
├── containers
│   ├── app
@sotayamashita
sotayamashita / what-forces-layout.md
Created September 23, 2015 05:32 — forked from paulirish/what-forces-layout.md
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.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@sotayamashita
sotayamashita / sanfrancisco-font.css
Last active April 4, 2023 23:53
San Francisco Web Font
/**
* http://applemusic.tumblr.com/
*/
/** Ultra Light */
@font-face {
font-family: "San Francisco";
font-weight: 100;
src: url("https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-ultralight-webfont.woff2");
}
@sotayamashita
sotayamashita / helloWorld.d.ts
Created September 15, 2015 12:50
🎓 Getting started with Typescript definition file
// Type definitions for helloWorld
// Project: github/sotayamashita/helloWorld
// Definitions by: Sota Yamashita <https://github.com/sotayamashita>
// Definitions: https://github.com/borisyankov/DefinitelyTyped