This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function generate() { | |
var numbers = []; | |
for (var i = 0; i < 6; i++) { | |
var number = Math.floor(Math.random()*45) + 1; | |
if(contains(numbers, number)) { | |
i--; | |
} else { | |
numbers.push(number); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream myFirstWebApp { | |
server unix:///tmp/myFirstWebApp.sock; | |
} | |
server { | |
listen 8080; | |
server_name localhost; | |
charset utf-8; | |
client_max_body_size 75M; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PersonForm(forms.ModelForm): | |
jobs = forms.ModelMultipleChoiceField(queryset=Job.objects.all(), | |
widget=forms.CheckboxSelectMultiple) | |
tags = forms.ModelMultipleChoiceField(queryset=Tag.objects.all(), widget=forms.SelectMultiple) | |
x = forms.FloatField(widget=forms.HiddenInput(),required=False) | |
y = forms.FloatField(widget=forms.HiddenInput(),required=False) | |
width = forms.FloatField(widget=forms.HiddenInput(),required=False) | |
height = forms.FloatField(widget=forms.HiddenInput(),required=False) | |
picture = forms.FileField(required=False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var loadForm = function(){ | |
var btn = $(this); | |
$.ajax({ | |
url : btn.attr('data-url'), | |
type : 'get', | |
dataType : 'json', | |
beforeSend: function(){ | |
$('#modal-theme').modal('show'); | |
}, | |
success: function(data) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import listdir | |
from os.path import splitext, join, isfile | |
from PIL import Image | |
path = '/Users/happy/Django/ohtto/media/' | |
for filename in listdir(path): | |
fullpath = path + filename | |
if isfile(fullpath) and fullpath != join(path, '.DS_Store'): | |
print(fullpath) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% load humanize %} | |
<table class="table table-striped table-bordered table-hover"> | |
<thead> | |
<tr> | |
<th width="20%">COST TYPE</th> | |
<th width="15%">CURRENCY</th> | |
<th width="45%">CONTENT</th> | |
<th width="20%">AMOUNT</th> | |
</tr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dal import autocomplete | |
from django import forms | |
from .models import Sales | |
class SalesForm(forms.ModelForm): | |
class Meta: | |
model = Sales | |
fields = ['name', 'customer'] | |
widgets = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import django | |
from selenium import webdriver | |
from django.conf import settings | |
from datetime import datetime | |
from bs4 import BeautifulSoup | |
from django.utils.timezone import make_aware | |
def text_strip(text): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<h2>Login</h2> | |
<form @submit.prevent="onSubmit(email, password)"> | |
<input type="text" v-model="email" placeholder="Email Address"> | |
<input type="password" v-model="password" placeholder="Password"> | |
<input type="submit" value="Login"> | |
</form> | |
</div> | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div id="signin"> | |
<div class="signin-form"> | |
<form @submit.prevent="signIn"> | |
<div class="input"> | |
<label for="username">사용자 ID</label> | |
<input | |
type="username" | |
id="username" | |
v-model="username"> |
OlderNewer