Skip to content

Instantly share code, notes, and snippets.

View MegaBlackLabel's full-sized avatar

底なし沼の魔女 MegaBlackLabel

View GitHub Profile
@MegaBlackLabel
MegaBlackLabel / App.js
Last active June 9, 2017 06:35
ReactとReduxを結ぶパッケージ「react-redux」についてconnectの実装パターンを試す ref: http://qiita.com/MegaBlackLabel/items/df868e734d199071b883
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import * as actionCreators1 from './actionCreators1';
import * as actionCreators2 from './actionCreators2';
version: '2'
services:
rocketchat:
image: rocketchat/rocket.chat:latest
container_name: rocketchat.[サーバ名]
restart: unless-stopped
volumes:
- /[PATH]/docker/rocketchat/app/uploads:/app/uploads
environment:
@MegaBlackLabel
MegaBlackLabel / fixed_index.js
Created March 14, 2017 00:33
ESDocが効かないパターン
import React from 'react';
import ReactDOM from 'react-dom';
import injectTapEventPlugin from 'react-tap-event-plugin';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import Main from './Main';
injectTapEventPlugin();
// ここでMainをMuiThemeProviderでラップする
const App = React.createElement(Main, {});
@MegaBlackLabel
MegaBlackLabel / manjaro_memo.md
Last active April 16, 2017 09:01
Manjaro i3構築メモ

Manjaro i3構築メモ

実施日

  • 初回:2017年4月5日

インストールしたバージョン

  • 2017年4月5日:Manjaro i3 17.0.1

インストールした端末

  • Thinkpad T460s
@MegaBlackLabel
MegaBlackLabel / Rocket.chat.md
Created September 27, 2017 07:04
Rocket.chatの設定

管理→サービス連携→新しいサービス連携

  • Incoming WebHook サービス連携

有効 はい 名前 (オプション) リポジトリ名 投稿先チャンネル 作成したルーム名(例#test) 投稿ユーザー bot(作成済みボットユーザ) エイリアス (オプション) [Gitbucket] スクリプトを有効にする はい

@MegaBlackLabel
MegaBlackLabel / Gitbucket.md
Created September 27, 2017 07:11
GitBucketの設定

作成したリポジトリの「Setting」 Service Hocks Add Webhook

Payload URL [Rocket.chatで取得したURLの先頭にrocketchat.を付与(例、ttp://rocketchat.[取得したサーバ名]/hooks/[トークン])]

Content type x-www-form-urlencode

Security Token 入力なし

@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';
@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 / 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 / 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: