Skip to content

Instantly share code, notes, and snippets.

View aceshim's full-sized avatar
🎯
Focusing

Jaehoon (Ace) Shim aceshim

🎯
Focusing
View GitHub Profile
import useSWR from 'swr'
// ===================== 원본 =============================
const useUser = (id) => {
const result = useQuery(`/user/${id}`, (url) => {
fetch(url).then(res =>
return res.json();
)
});
import React, { Component } from 'react';
class SampleButton extends Component {
onClick = (id) => {
console.log(id);
// 하고싶은거 하세요
}
render = () => {
return (
import Caver from 'caver-js'
const BAOBAB_TESTNET_RPC_URL = 'https://api.baobab.klaytn.net:8651/'
const rpcURL = BAOBAB_TESTNET_RPC_URL
const caver = new Caver(rpcURL)
const OracleContract = DEPLOYED_ABI
&& DEPLOYED_ADDRESS
@aceshim
aceshim / Jonbur.test
Created October 3, 2019 06:05
jonbur solidity
pragma solidity ^0.5.0;
contract JonburTest{
struct Jonbur{
uint date;
string comment;
uint amount;
}
address public owner;
@aceshim
aceshim / init.sh
Last active September 21, 2019 12:55
init.sh
#!/bin/bash
# Starts 2 redis instances at ports 6379 and 6380 for testing
# Kills whatever's already running at 6379 and 6380
if lsof -Pi :6379 -sTCP:LISTEN -t >/dev/null ; then
redis-cli -p 6379 shutdown
fi
redis-server --port 6379 --daemonize yes &> /dev/null
redis-cli -p 6379 flushall
#!/bin/bash
# Starts 2 redis instances at ports 6379 and 6380 for testing
# Kills whatever's already running at 6379 and 6380
if lsof -Pi :6379 -sTCP:LISTEN -t >/dev/null ; then
redis-cli -p 6379 shutdown
fi
redis-server --port 6379 --daemonize yes &> /dev/null
redis-cli -p 6379 flushall