Skip to content

Instantly share code, notes, and snippets.

@hiro08gh
hiro08gh / setup.sh
Created March 20, 2022 02:07
mac setup scrpipt
#!/bin/bash
SUDO_USER=$(whoami)
if test ! $(which brew); then
echo "Installing homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
echo "Updateing homebrew..."
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
#!/bin/bash
if [ "$#" -eq 0 ]; then
tmux new-session -d -s 'ide'
tmux attach -t ide
tmux split-window -v -p 30
tmux split-window -h -p 66
tmux split-window -h -p 50
tmux select-pane -t 1
else
case $1 in
import useClickOutside from './useClickOutside';
const Menu = () => {
const menuRef = useRef();
const onClickOutside = () => {
console.log('click');
}
useClickOutside(menuRef, onClickOutside)
@hiro08gh
hiro08gh / deploy.sh
Created February 4, 2020 00:34
デプロイシェル
# $ chmode 755 deploy.sh
# $ ./deploy.sh
#!/bin/bash
set -e
CLONE_TO=/path/to/clone
REPO_URL=git@github.com:hiro08gh/repos.git
BRANCH=master
@hiro08gh
hiro08gh / config.yml
Created February 3, 2020 14:19
Fireabase + react-snapでCricle CIを回す設定
version: 2
jobs:
build:
docker:
- image: circleci/node:10.13-browsers
working_directory: ~/repo
steps:
- checkout
@hiro08gh
hiro08gh / index.js
Created January 15, 2020 01:23
upload
import React, {useState} from 'react';
import PhotoUpload from './PhotoUpload';
import PhotoList from './PhotoList';
const PhotoUploadContainer = () => {
const [image, setImage] = useState('');
const handleUpload = () => {
...any
}
@hiro08gh
hiro08gh / install.sh
Last active January 15, 2020 01:25
ドットファイルにシンボリックリンク貼るスクリプト
#!/bin/bash
DOT_FILES=( .zshrc .tmux.conf .vimrc )
for file in ${DOT_FILES[@]}
do
ln -s $HOME/dotfiles/$file $HOME/$file
done
@hiro08gh
hiro08gh / index.tsx
Last active September 4, 2019 23:51
外部サービスの各種設定
import React from 'react';
import { render } from 'react-dom';
import { Router } from 'react-router-dom';
import ReactGA from 'react-ga';
import {hotjar} from 'react-hotjar';
import * as Sentry from '@sentry/browser';
import App from './App';
const { NODE_ENV } = process.env;
@hiro08gh
hiro08gh / useInput.js
Last active September 2, 2019 13:34
値を変更するhooks part2
import React, {useState} from 'react';
const useInput = (initialValue) => {
const [name, setVName] = setState(initialValue);
const onChange = (e) => {
setValue(e.target.value);
}
return [value, onChange];