Skip to content

Instantly share code, notes, and snippets.

@ukyo
ukyo / angular-storybook.md
Last active November 9, 2018 11:57
AngularでStorybook使う

前提

Angular 7, Storybook 4系

環境作る

まずはng newする。

$ ng new hoge --createApplication=false --style=scss
@ukyo
ukyo / bazel-ng-new-schematics.md
Last active December 20, 2018 08:47
bazel ng new schematics Angular 7.2.0-rc.0

インスコ

$ npm install -g @angular/cli@next @angular/bazel@next

ng new する

$ ng new my-bazel-app --collection=@angular/bazel
@ukyo
ukyo / pixelmatch.ts
Created April 24, 2019 03:38
wip pixelmatch.ts
export function pixelmatch(img1: u32, img2: u32, width: u32, height: u32): u32 {
let maxDelta = (35215 as f32) * 0.1 * 0.1;
let diff = 0;
for (let y: u32 = 0; y < height; y++) {
for (let x: u32 = 0; x < width; x++) {
let pos = (y * width + x) * 4;
let delta = colorDelta(img1, img2, pos, pos, false);
if (delta > maxDelta) {
diff++;
drawPixel(img1 + img2, pos, 255, 0, 0);