Skip to content

Instantly share code, notes, and snippets.


Jungwon Seo thejungwon

View GitHub Profile
View test2.js
//1. Get a value by id
var value = $('#test_id').val();
//2. Get a value by class
var value = $('.test_class').val();
//3. Get a value by name
var value = $('input[name=test_name]').val();
View test.html
<input type="hidden" id="test_id" class="test_class" name="test_name" value="test">
View test.js
//1. id 로 접근해서 가져오기
var value = $('#test_id').val();
//2. class 로 접근해서 가져오기
var value = $('.test_class').val();
//3. name으로 접근해서 가져오기
var value = $('input[name=test_name]').val();
View test.html
<!--sample div -->
<div class="test_class" id="test_id" name="test_name"></div>
View javascript-version.js
//1. By id
var name_by_id = document.getElementById("test_id").getAttribute('name');
var class_by_id = document.getElementById('test_id').ClassName;
//2. By class
var name_by_class = document.getElementsByClassName('test_class')[0].getAttribute('name');
var class_by_class = document.getElementsByClassName('test_class')[0].id;
//3. By name
var id_by_name = document.getElementsByName('test_name')[0].id;
var class_by_name = document.getElementsByName('test_name')[0].className;
View jquery-version.js
//1. By id
var name_by_id = $('#test_id').attr('name');
var class_by_id = $('#test_id').attr('class');
//2. By class
var name_by_class = $('.test_class').attr('name');
var id_by_class = $('.test_class').attr('id');
//3. By name
var id_by_name = $('[name="test_name"]').attr('id');
var class_by_name = $('[name="test_name"]').attr('class');
View Dockerfile
# build environment
FROM node:9.6.1 as builder
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
ENV PATH /usr/src/app/node_modules/.bin:$PATH
COPY package.json /usr/src/app/package.json
RUN npm install --silent
RUN npm install react-scripts@1.1.1 -g --silent
COPY . /usr/src/app
RUN npm run build
cd src
python makemigrations
until python migrate; do
sleep 2
echo "Retry!";
python shell <
python makemigrations app
View Dockerfile
FROM python:3
WORKDIR /usr/src/app
COPY requirements.txt ./
RUN pip install -r requirements.txt
COPY . .
RUN chmod +x
CMD [ "./" ]
from django.shortcuts import render
from django.http import HttpResponse
from django.shortcuts import render
from .models import *
import datetime
import base64
import requests
def index(request):
p = Post(, photo=random_picture())
You can’t perform that action at this time.