Skip to content

Instantly share code, notes, and snippets.

View MegaBlackLabel's full-sized avatar

底なし沼の魔女 MegaBlackLabel

View GitHub Profile
@MegaBlackLabel
MegaBlackLabel / comiket-catalog-viewer
Last active January 2, 2024 05:07
コミケカタログビューア(案)
# コミケカタログビューア(案)
## 概要
WEBカタログではネットワーク状況が悪いコミケ会場では使いにくい。
会場でも使いやすくするために以下の改善をする
- sql.jsとIndexedDBを使ってローカルにデータを保存する
- PWAアプリ化してサーバへのアクセスを最小限にする
- データをGoogle driveにバックアップできるようにする
# See https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml
run:
linters-settings:
govet:
enable-all: true
disable:
- shadow
unused:
check-exported: true
unparam:
@MegaBlackLabel
MegaBlackLabel / clean_architecture.md
Created April 23, 2020 08:56 — forked from mpppk/clean_architecture.md
クリーンアーキテクチャ完全に理解した

実装から学ぶクリーンアーキテクチャ

クリーンアーキテクチャはRobert C. Martin(Uncle Bob)が2012年に提唱した、DBやフレークワークからの独立性を確保するためのアーキテクチャであり、以下の図が大変有名です。

CleanArchitecture.jpg

最初にクリーンアーキテクチャについて言及されたブログが書かれてからは既に7年が経過しており、書籍Clean Architecture 達人に学ぶソフトウェアの構造と設計をはじめ、日本語での情報も十分存在します。 しかし私が学び始めた時、以下の理由で理解が難しいと感じました。

  • DDDの概念や用語を流用しているが、レイヤーに関する考え方はDDDとは異なる
@MegaBlackLabel
MegaBlackLabel / upload_dropbox.sh
Last active April 14, 2018 13:06
Circle CIでビルド完了後にDropBoxにファイルをアップロードする。(🍏さんのシェルを改修)
#!/bin/sh
if [ $# != 2 ]
then
echo 'Usage: upload_dropbox.sh <file> <token>'
exit 1
fi
filename=XXXXX.pdf
@MegaBlackLabel
MegaBlackLabel / tslint.json
Created February 12, 2018 13:19 — forked from oukayuka/tslint.json
My TSLint configuration
{
"extends": [
"tslint:latest",
"tslint-config-airbnb",
"tslint-config-prettier",
"tslint-eslint-rules",
"tslint-react"
],
"rulesDirectory": [
"tslint-plugin-prettier"
@MegaBlackLabel
MegaBlackLabel / index.ts
Created February 7, 2018 03:01 — forked from monzou/index.ts
Next.js + TypeScript
import { Context } from 'next'
import Head from 'next/head'
import * as React from 'react'
import { compose, lifecycle, pure, wrapDisplayName } from 'recompose'
function withInitialProps<Props>(provider: (context: Context) => object) {
return (BaseComponent: React.ComponentType<Props>) => {
return class extends React.Component<Props> {
public static displayName = wrapDisplayName(BaseComponent, 'withInitialProps')
public static async getInitialProps(context: Context) {
@MegaBlackLabel
MegaBlackLabel / Counter.jsx
Created February 7, 2018 02:59 — forked from joeporpeglia/Counter.jsx
Redux as a Render Prop
import StoreProvider from './StoreProvider';
const increment = { type: '@counter/increment' };
const decrement = { type: '@counter/decrement' };
const initialState = { count: 0 };
const reducer = (state = initialState, action) => {
switch (action.type) {
case increment.type:
@MegaBlackLabel
MegaBlackLabel / FlashMessage.tsx
Created February 6, 2018 21:30 — forked from oukayuka/FlashMessage.tsx
Recompose withStateHandlers with TypeScript
import * as React from 'react';
import { compose, lifecycle, pure, StateHandler, StateHandlerMap, withStateHandlers } from 'recompose';
import { Message, Transition } from 'semantic-ui-react';
import './FlashMessage.css';
export interface FlashMessageProps {
message: string;
isWarning?: boolean;
}
@MegaBlackLabel
MegaBlackLabel / app.js
Last active February 1, 2018 08:53
react-move sample with recompose and styled-components
import React, { PureComponent } from 'react';
import Animate from 'react-move/Animate';
import { easeExpOut, easeExpIn, easeCircleOut, easeSinIn, easeSinOut, easeCubicInOut } from 'd3-ease';
import styled from 'styled-components';
import { compose, lifecycle, pure, withHandlers, withStateHandlers } from 'recompose';
const Rect = styled.div.attrs({
opacity: props => {
const width = props.x - (props.order - 1) * 60;
return props.order === "1" ? 0.7 : props.opacity;
@MegaBlackLabel
MegaBlackLabel / AuthorizationHOC.js
Created February 1, 2018 07:07 — forked from wuct/AuthorizationHOC.js
An authorization high-order-component using recompose, redux and react-router.
import { emptyObject } from 'fbjs/lib/emptyObject';
import { connect } from 'react-redux';
import { pushState } from 'redux-router';
import pure from 'recompose/pure';
import defaultProps from 'recompose/defaultProps';
import doOnReceiveProps from 'recompose/doOnReceiveProps';
import renderNothing from 'recompose/renderNothing';
import renderComponent from 'recompose/renderComponent';
import branch from 'recompose/branch';
import compose from 'recompose/compose';