Skip to content

Instantly share code, notes, and snippets.

Avatar

Sangkon, Han sigmadream

View GitHub Profile
View Board.java
package com.sangkon.models;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity
public class Board {
View todo1.html
<html>
<head>
<title>Django Busan User Group :: 101 - TodoList</title>
<script defer src="https://use.fontawesome.com/releases/v5.0.2/js/all.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/js/bootstrap.min.js" integrity="sha384-a5N7Y/aK3qNeh15eJKGWxsqtnX/wWdSZSKp+81YjTmS15nvnvxKHuzaWwXHDli+4" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/css/bootstrap.min.css" integrity="sha384-Zug+QiDoJOrZ5t4lssLdxGhVrurbmBWopoEl+M6BdEfwnCJZtKxi1KgxUyJq13dy" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Josefin+Slab" rel="stylesheet" type="text/css">
</head>
View base.md
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{% block title %}Django ToDo List{% endblock %}</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous">
    <link rel="stylesheet" href="{% static "css/styles.css" %}">
</head>
@sigmadream
sigmadream / SpringSnippets.md
Last active Dec 7, 2017
ClassPathResource 사용법
View SpringSnippets.md
  • 스프링에서 ClassPathResource에서 파일을 가져오거나 저장하는 방법
public void startupCheckForKeys() throws Exception {
	ClassPathResource classPathResource = new ClassPathResource("FILENAME");
	if (!classPathResource.exists()) {
		throw new Exception();
	} else {
		logger.info("file present");
	}
View postgresq.md

우분투 16.04에서 postgresql을 설치

$ sudo add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main"
$ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install postgresql-9.6

사용법

View mongo_backup.md
mongodump --host 127.0.0.1
tar zcvf dump.tar.gz dump
scp -i [PEMFile] username@ip.ip.ip.ip:~/home/file .
mongorestore -h 127.0.0.1 ./dump
db.copyDatabase("db_to_rename","db_renamed","localhost")
@sigmadream
sigmadream / how-to.md
Created Sep 8, 2017 — forked from CheeseStick/how-to.md
Mac OS X에서 OpenCV 설치 및 Xcode Project 설정방법
View how-to.md

Mac OS X에서 Open CV 설치 및 Xcode에서 사용하기

1. Homebrew를 통해 openCV 설치

(홈브루가 설치되어 있지 않다면 https://brew.sh/index_ko.html 참고)

brew update
brew install opencv
View MySQL57-with-1604.md
$ sudo apt update
$ sudo apt upgrade
$ sudo apt remove vim-tiny
$ sudo ln -fs /usr/share/zoneinfo/UTC /etc/localtime

$ sudo apt install mysql-server mysql-client
$ sudo mysql_secure_installation
$ sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf (#bind...)
$ mysql -u root -p
@sigmadream
sigmadream / java-about-date.md
Last active Aug 20, 2017
Java 날짜관련 몇가지 이상한(?) 점
View java-about-date.md

1582년 10월 4일 => 1582년 10월 15일(달력변경)

public class OldJdkDateTest {

    @Test
    public void shouldGetAfterOneDay() {
        TimeZone utc = TimeZone.getTimeZone("UTC");
        Calendar calendar = Calendar.getInstance(utc);
        calendar.set(1582, Calendar.OCTOBER , 4);
        String pattern = "yyyy.MM.dd";
@sigmadream
sigmadream / mognodb.md
Last active Aug 20, 2017
정규식을 사용해서 `.(dot)`이 포함된 값을 지닌 객체를 삭제
View mognodb.md
db.getCollection('activities').find({"actList.c": {$regex: "[.]{1}"}})