Skip to content

Instantly share code, notes, and snippets.

View 1206yaya's full-sized avatar

aya 1206yaya

  • Japan Tokyo
View GitHub Profile
@1206yaya
1206yaya / SpringbootService.service
Last active August 30, 2022 04:48
Osho Production Web
# File Location /etc/systemd/system/SpringbootService.service
[Unit]
Description=SpringbootService
[Service]
Type=simple
WorkingDirectory=/www/api
ExecStart=/www/api/exec.sh outside
ExecStop=/bin/kill -s QUIT $MAINPID
Restart=on-failure
User=root
# curl -o /etc/nginx/conf.d/jenkins.conf https://gist.githubusercontent.com/1206yaya/3b953e7d6df431f306c3255ca43161ef/raw/9053808d295db944f5d102416ad0fe64abc8a90a/gistfile1.txt
upstream jenkins {
server 127.0.0.1:8080;
}
server {
listen 80 default;
server_name sample.jenkins;
access_log /var/log/nginx/access.log;
@1206yaya
1206yaya / index.html
Last active May 29, 2022 00:13 — forked from jcollins-g/index.html
DartPad
<!-- Copyright 2011 the Dart project authors. All rights reserved.
Use of this source code is governed by a BSD-style license
that can be found in the LICENSE file. -->
<h2>Dr. Fibonacci's Sunflower Spectacular</h2>
<div>
<canvas id="canvas" width="300" height="300"></canvas>
</div>
@1206yaya
1206yaya / jenkins.Dockerfile
Last active April 16, 2020 23:03
JenkinsでDockerをつかえるように
FROM jenkins/jenkins:lts
# Install plugins
COPY ./plugins.txt /usr/share/jenkins/ref/plugins.txt
RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt
USER root
RUN apt-get update
##### Docker install START >>>
# 前提ソフトウェアのインストール
@1206yaya
1206yaya / cloudSettings
Last active November 17, 2020 03:54
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-11-17T03:54:22.356Z","extensionVersion":"v3.4.3"}
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.1.2/backbone-min.js"></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
@1206yaya
1206yaya / 01_reactで用いる概念.md
Last active August 23, 2019 05:29
react_redux_概要 #redux #react
  • コンポーネント

  • Props 親 コンポーネントの属性。つまり、コンポーネントのinterface、React.propTypesで宣言的に記述する。immutable

  • State 自身 コンポーネントの状態。たくさんのstateを持つ場合は、複雑とも言える。mutable

@1206yaya
1206yaya / redux_reducerについて.md
Created August 16, 2019 23:18
redux_reducerについて #redux #react

Reducer 自体は function ですが、Reducer 名がそのまま state 名になります。

function errorMessage(state = null, action) {
  ...
  return newState;
}
@1206yaya
1206yaya / 1_Reducerのテスト.md
Last active August 25, 2019 05:29
react_jest_テストについて #js #react #jest

サンプルコード sample-react-redux-jest

reducerのテスト方針

stateとactionを用意して、更新後のstateが期待したものになっているかを検証する

src/reducers/counter.js

const defaultState = {
  count: 0
@1206yaya
1206yaya / インラインアロー関数.js
Last active May 2, 2020 10:41
Reactであれどうやるんだっけ?集 #js #react
const [inputState, setInputState] = useState({ title: '', amount: '' });
...
return (
...
<input
value={inputState.title}
onChange={event => {
const newTitle = event.target.value;
// setInputStateにはObjectを渡す