Skip to content

Instantly share code, notes, and snippets.

@shinyoshiaki
shinyoshiaki / file0.txt
Last active January 31, 2019 02:07
React Hooksでobject(オブジェクト)を使うCustom Hooks(カスタムフック) ref: https://qiita.com/ShinYoshiaki/items/a60f8ff343a178f681c9
import { useState } from "react";
export default function useObject<T>(obj: T) {
const [state, setObj] = useState({ ...obj });
const setState = (next: Partial<T>) => {
setObj(prev => {
return { ...prev, ...next };
});
};
@shinyoshiaki
shinyoshiaki / softether.sh
Last active February 12, 2018 08:56 — forked from bouroo/softether.sh
Install softether vpn server on ubuntu 16.04+
#!/usr/local/env bash
# Update system
apt-get update && apt-get -y upgrade
# Get build tools
apt-get -y install build-essential wget curl
# Get softether source
wget "http://jp.softether-download.com/files/softether/v4.25-9656-rtm-2018.01.15-tree/Linux/SoftEther_VPN_Server/64bit_-_Intel_x64_or_AMD64/softether-vpnserver-v4.25-9656-rtm-2018.01.15-linux-x64-64bit.tar.gz" -O /tmp/softether-vpnserver.tar.gz
@shinyoshiaki
shinyoshiaki / stuns
Created July 23, 2017 14:12 — forked from yetithefoot/stuns
STUN+TURN servers list
{url:'stun:stun01.sipphone.com'},
{url:'stun:stun.ekiga.net'},
{url:'stun:stun.fwdnet.net'},
{url:'stun:stun.ideasip.com'},
{url:'stun:stun.iptel.org'},
{url:'stun:stun.rixtelecom.se'},
{url:'stun:stun.schlund.de'},
{url:'stun:stun.l.google.com:19302'},
{url:'stun:stun1.l.google.com:19302'},
{url:'stun:stun2.l.google.com:19302'},