Skip to content

Instantly share code, notes, and snippets.

View code-machina's full-sized avatar
😌
Humble

GB Kim code-machina

😌
Humble
View GitHub Profile
@code-machina
code-machina / Student.java
Created April 5, 2019 07:01
Model for Spring DAL
package com.gbkim.student.dal.entities;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@code-machina
code-machina / studentdal.sql
Created April 5, 2019 06:58
Mysql Sql Example for Student DAL(Data Access Layer)
create database projectdb
use projectdb
create table studenttab(
id int PRIMARY KEY AUTO_INCREMENT,
sname varchar(20),
scourse varchar(30),
sfee int
)
@code-machina
code-machina / StudentdalApplicationTests.java
Last active October 31, 2020 06:03
Student Model Sample
package com.gbkim.student.dal;
import java.util.Optional;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@code-machina
code-machina / AWS_CLI.command
Last active March 23, 2019 06:41
AWS CLI command
# AWS 인스턴스를 실행
aws ec2 run-instances --instance-type [인스턴스 타입을 입력, t2.micro] --image-id [AMI 아이디를 입력, 인스턴스 정보] --count [생성할 인스턴스 수를 입력, 숫자]
# Topic : Create Custom AMI
## 권한 상승
sudo su
## 업데이트
yum update -y
## 아파치 웹서버 설치
@code-machina
code-machina / helloworld.sol
Last active December 17, 2018 02:37
Examples of solidity ^0.5.1
pragma solidity ^0.5.1; // (1) Version pragma
contract Helloworld {
// 문자열 멤버 변수
string public greeting;
// memory 키워드가 반드시 있어야 한다.
// greeting 멤버 변수를 초기화
function setGreeting(string memory _greeting) public {
greeting = _greeting;
@code-machina
code-machina / curl_check_eth_mining.sh
Created December 16, 2018 23:34
Ethereum JSON-RPC 명령어 모음 (geth, ethereum, json-rpc)
# ethereum 마이닝이 진행 중인지 확인한다.
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0", "method":"eth_mining","params":[], "id":10}' ${RPC_HOST}:8545
# output: {"jsonrpc":"2.0","id":10,"result":true}
@code-machina
code-machina / ISP.cs
Created December 15, 2018 01:05
Interface Segregation Principle (ISP) PoC
using System;
namespace DotNetDesignPatternDemos.SOLID.InterfaceSegregationPrinciple
{
public class Document
{
}
public interface IMachine
{
@code-machina
code-machina / index.vue
Last active December 11, 2018 23:09
[nuxt] Links and Navigating Around : nuxt-link
<!-- nuxt-link 를 사용하여 Navigate 와 Link 를 다룰 수 있음
to attribute : navigate 경로를 지정-->
<template>
<section class="container">
<nuxt-link to="/users">Users</nuxt-link>
</section>
</template>
<script>
import Logo from '~/components/Logo.vue'
@code-machina
code-machina / wget-genesis.sh
Created December 9, 2018 09:06
Download genesis.json from gist
wget https://gist.githubusercontent.com/code-machina/2ccfe2843bb8777394f7adf6bb8707d8/raw/1bd98178b34f02aa1d00b9e0c5a0821c3ac60ff6/genesis.json
@code-machina
code-machina / genesis.json
Created December 9, 2018 09:01
Genesis.json to create genesis block in ethereum test-net
{
"config": {
"chainId": 33,
"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0
},
"nonce": "0x0000000000000033",
"timestamp": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",