Skip to content

Instantly share code, notes, and snippets.

View ssafy-john's full-sized avatar

john ssafy-john

View GitHub Profile
@ssafy-john
ssafy-john / movies.json
Created November 7, 2019 23:56
Movies JSON
[
{
"id": 1,
"name": "82년생 김지영",
"rating": "12세이상관람가",
"genre_id": 1,
"director": "김도영",
"user_rating": 6.61,
"poster_url": "https://movie-phinf.pstatic.net/20191024_215/1571900079078PNazL_JPEG/movie_image.jpg",
"description": "1982년 봄에 태어나 누군가의 딸이자 아내, 동료이자 엄마로 2019년 오늘을 살아가는 ‘지영’(정유미). 때론 어딘가 갇힌 듯 답답하기도 하지만 남편 ‘대현’(공유)과 사랑스러운 딸, 그리고 자주 만나지 못해도 항상 든든한 가족들이 ‘지영’에겐 큰 힘이다. 하지만 언젠가부터 마치 다른 사람이 된 것처럼 말하는 ‘지영’. ‘대현’은 아내가 상처 입을까 두려워 그 사실을 털어놓지 못하고 ‘지영’은 이런 ‘대현’에게 언제나 “괜찮다”라며 웃어 보이기만 하는데… 모두가 알지만 아무도 몰랐던 당신과 나의 이야기"
@ssafy-john
ssafy-john / genres.json
Created November 7, 2019 23:55
Genres JSON
[
{
"id": 1,
"name": "드라마"
},
{
"id": 2,
"name": "액션"
},
{
@ssafy-john
ssafy-john / main.js
Created October 30, 2019 06:26
Giphy Search Engine
/* 1. <input> 태그 안의 값을 잡는다. */
const inputArea = document.querySelector('#js-userinput')
const button = document.querySelector('#js-go')
const resultArea = document.querySelector('#result-area')
button.addEventListener('click', e => {
searchAndPush(inputArea.value)
})
inputArea.addEventListener('keydown', e => {
@ssafy-john
ssafy-john / relation.md
Created October 25, 2019 02:18
Django ORM relation

1:N

u1 = User.objects.create(username='Kim')
u2 = User.objects.create(username='Lee')

a1 = Article.objects.create(title='1글', user=u1)
a2 = Article.objects.create(title='2글', user=u2)
a3 = Article.objects.create(title='3글', user=u2)
a4 = Article.objects.create(title='4글', user=u2)
@ssafy-john
ssafy-john / SQL.md
Created October 25, 2019 02:15
SQL & Dango ORM
@ssafy-john
ssafy-john / lotto.py
Created September 4, 2019 04:54
로또 추천 python 코드
import random
def getLotto():
winner = [1, 15, 19, 23, 28, 42]
lotto = sorted(random.sample(range(1, 46), 6))
cnt = len(set(winner) & set(lotto))
# 6, 1등
@ssafy-john
ssafy-john / lotto.py
Created September 4, 2019 04:54
로또 추천 python 코드
import random
def getLotto():
winner = [1, 15, 19, 23, 28, 42]
lotto = sorted(random.sample(range(1, 46), 6))
cnt = len(set(winner) & set(lotto))
# 6, 1등
@ssafy-john
ssafy-john / lotto.js
Created September 4, 2019 02:48
로또 추천 코드
/*
1부터 45까지의 숫자 중, 6개를 '비복원추출'한다.
> [1, 3, 5, 11, 25, 32]
(힌트) lodash 활용하면 간단히 가능
*/
const _ = require('lodash')
@ssafy-john
ssafy-john / lotto.js
Created August 30, 2019 06:14
complete lotto.js
// 로또 번호 추천기
const _ = require('lodash')
const axios = require('axios')
// const winner = [3, 5, 12, 13, 33, 39]
// winner와 비교하여,
// 추천한 랜덤 번호가 몇 등인지 알려주는 함수 rank()
@ssafy-john
ssafy-john / lotto.js
Created August 30, 2019 05:23
lotto javascript 코드
// 로또 번호 추천기
const _ = require('lodash')
const winner = [3, 5, 12, 13, 33, 39]
// winner와 비교하여,
// 추천한 랜덤 번호가 몇 등인지 알려주는 함수 rank()
// 6개 - 1등