Skip to content

Instantly share code, notes, and snippets.

View lu911's full-sized avatar
🎯
Focusing

Seungchan Yuk lu911

🎯
Focusing
View GitHub Profile
@lu911
lu911 / models.py
Created January 30, 2022 16:58
Django M2M
# -*- coding: utf-8 -*-
from django.db import models
class Person(models.Model):
name = models.CharField(max_length=128)
class Group(models.Model):
name = models.CharField(max_length=128)
@lu911
lu911 / models.py
Last active October 13, 2022 10:50
django-prefetch_related
# -*- coding: utf-8 -*-
from django.db import models
class Person(models.Model):
name = models.CharField(max_length=128)
class Group(models.Model):
name = models.CharField(max_length=128)
@lu911
lu911 / deploy.py
Created February 24, 2017 10:23
ddingdon deploy
@task
def deploy():
"""
Deploy the project.
"""
# check stage
require('stage', provided_by=(stage_api, stage_admin,
production_api, production_admin))
@lu911
lu911 / docker-compose.yml
Created February 24, 2017 06:58
ddingdon docker-compose
version: '2'
services:
postgres:
restart: always
image: postgres:9.4
hostname: postgres
container_name: pg
ports:
- "5432:5432"
@lu911
lu911 / pipeline.groovy
Last active February 22, 2017 12:07
ddingdon-pipeline
node {
stage('Checkout') {
git branch: 'develop', url: 'GIT_URL', credentialsId: 'github'
gitCommit = sh(returnStdout: true, script: 'git rev-parse HEAD').trim()
}
stage('Docker "base" image pull') {
docker.withRegistry('https://123456789.dkr.ecr.ap-northeast-1.amazonaws.com', 'ecr:ap-northeast-1:aws-ecr') {
docker.image('123456789.dkr.ecr.ap-northeast-1.amazonaws.com/base:latest').pull()
}
@lu911
lu911 / Dockerfile
Last active February 22, 2017 10:52
ddingdon-api
FROM base:latest
MAINTAINER Loup <[email protected]>
# project setting
RUN mkdir /home/release && \
mkdir /home/release/code && \
mkdir /home/release/conf && \
mkdir /home/release/tmp
COPY . /home/release/code
RUN pip install -r /home/release/code/requirements.txt
@lu911
lu911 / Dockerfile
Last active February 22, 2017 10:52
ddingdon-admin
FROM base:latest
MAINTAINER Loup <[email protected]>
# project setting
RUN mkdir /home/release && \
mkdir /home/release/code && \
mkdir /home/release/conf && \
mkdir /home/release/tmp
COPY . /home/release/code
RUN pip install -r /home/release/code/requirements.txt
@lu911
lu911 / Dockerfile
Last active February 22, 2017 09:18
ddingdon-base
FROM ubuntu:16.04
MAINTAINER Loup <[email protected]>
# Install pyenv
ENV PYENV_ROOT /root/.pyenv
ENV PATH /root/.pyenv/shims:/root/.pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
RUN apt-get update && \
apt-get install -y git mercurial build-essential libssl-dev libbz2-dev libreadline-dev libsqlite3-dev curl vim && \
curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
@lu911
lu911 / mutation_2.graphql
Created December 9, 2016 07:31
Update Mutation
fragment userAllFields on User {
id
name
age
gender
}
mutation {
updateUser(userData: {id: 1, name: "test2"}) {
@lu911
lu911 / mutation_1.graphql
Created December 9, 2016 07:30
Mutation Execute
fragment userAllFields on User {
id
name
age
gender
}
mutation {
createUser(name: "test", age: 11, gender: FEMALE) {