Skip to content

Instantly share code, notes, and snippets.

View thejungwon's full-sized avatar
🦄
Focusing

Jungwon Seo thejungwon

🦄
Focusing
View GitHub Profile
//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;
//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');
# 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
#!/bin/bash
cd src
python manage.py makemigrations
until python manage.py migrate; do
sleep 2
echo "Retry!";
done
python manage.py shell < init_admin.py
python manage.py makemigrations app
FROM python:3
WORKDIR /usr/src/app
COPY requirements.txt ./
RUN pip install -r requirements.txt
COPY . .
EXPOSE 8000
RUN chmod +x entry_point.sh
CMD [ "./entry_point.sh" ]
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(date=datetime.datetime.now(), photo=random_picture())
p.save(force_insert=True)
version: '3.3'
services:
app:
build:
context: .
dockerfile: Dockerfile
expose:
- "8000"
ports:
master
slave1
slave2
<configuration>
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
<property>
<name>yarn.app.mapreduce.am.env</name>
<value>HADOOP_MAPRED_HOME=${HADOOP_HOME}</value>
</property>
<property>