Skip to content

Instantly share code, notes, and snippets.

💭
🔪

Takayosi Amagi fand

💭
🔪
Block or report user

Report or block fand

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@fand
fand / uniforms.md
Last active Apr 12, 2018
GLSL uniform values conversion table
View uniforms.md
@fand
fand / color.glsl
Created May 28, 2017
glslify sourcemaps test
View color.glsl
vec3 color(in vec2 p) {
return vec3(p.x, p.y, p.x + p.y);
}
#pragma glslify: export(color)
@fand
fand / console.txt
Last active May 28, 2017
npm install fails on glslify-bundle
View console.txt
glslify-bundle git/master
❯ npm i
npm WARN deprecated standard-format@1.6.10: standard-format is deprecated in favor of a built-in autofixer in 'standard'. Usage: standard --fix
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN lifecycle The node binary used for scripts is /Users/amagitakayosi/.anyenv/envs/nodenv/shims/node but npm is using /usr/local/Cellar/node/7.10.0/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
npm WARN prefer global node-gyp@3.6.1 should be installed with -g
> gl@2.1.5 install /Users/amagitakayosi/src/github.com/fand/glslify-bundle/node_modules/gl
> prebuild --download
@fand
fand / base.glsl
Created May 22, 2017
1分でわかるglsl
View base.glsl
#ifdef GL_ES
precision mediump float;
#endif
uniform float time;
uniform vec2 mouse;
uniform vec2 resolution;
uniform sampler2D backBuffer;
#define PI 3.141592
View 09.glsl
void main(void){
vec2 st = gl_FragCoord.xy/u_resolution.xy;
vec3 color = vec3(0.0);
// Divide the space in 4
st = tile(st,4.);
color += vec3(box(st,vec2(.96),0.01));
st = rotate2D(st,PI*0.25);
@fand
fand / log.txt
Last active May 12, 2017
npm cache clean && npm install -g webgl-workshop --verbose
View log.txt
❯ npm install -g webgl-workshop --verbose
npm info it worked if it ends with ok
npm verb cli [ '/usr/local/Cellar/node/7.9.0/bin/node',
npm verb cli '/usr/local/bin/npm',
npm verb cli 'install',
npm verb cli '-g',
npm verb cli 'webgl-workshop',
npm verb cli '--verbose' ]
npm info using npm@4.2.0
npm info using node@v7.9.0
View metaball.frag
#ifdef GL_ES
precision mediump float;
#endif
#extension GL_OES_standard_derivatives : enable
uniform float time;
uniform vec2 mouse;
uniform vec2 resolution;
float metaball (in vec2 position) {
@fand
fand / Validator.js
Created Jan 17, 2017
input要素をラップしてsetCustomValidityしてくれる君
View Validator.js
const React = require('react');
class Validator extends React.Component {
static propTypes = {
inputProps : React.PropTypes.object.required,
isValid : React.PropTypes.boolean.required,
message : React.PropTypes.object.required,
}
@fand
fand / gekidasa.js
Last active Dec 20, 2016
セミコロン付けるとダサい.js
View gekidasa.js
import React from 'react';
export default class Foo extends React.Component {
constructor () {
super();
this.state = { count : 0 };
}
increment = () => this.setState({ count : this.state.count + 1 }) // ;付けるとダサい気がする
@fand
fand / codebase_overview.md
Last active Dec 12, 2016
ReactのCodebase Overview, Implementation Notes要約
View codebase_overview.md

Codebase Overview

https://facebook.github.io/react/contributing/codebase-overview.html

Custom Module System

  • FacebookではHasteというモジュールシステムを使っている
    • all filenames are globally unique
    • require('../foo/bar') の代わりに require('bar') とする
    • ファイル移動しても壊れない
    • Fuzzy Finder使いやすい
  • ビルド時に、全てのファイルを /lib 下にフラットに配置する
You can’t perform that action at this time.