Skip to content

Instantly share code, notes, and snippets.

View happychallenge's full-sized avatar

Happy Challenge happychallenge

View GitHub Profile
<template>
<Page class="page">
<ActionBar title="Geolocation" class="action-bar" />
<ScrollView>
<StackLayout class="home-panel">
<Image src="~/images/map-marker-icon.png" height="60" />
<Button text="Get My Location" @tap="getLocation" class="btn btn-primary" />
<Label :text="'Latitude: ' + lat" class="lbl" />
<Label :text="'Longitude: ' + lon" class="lbl" />
@happychallenge
happychallenge / FloatLabel.vue
Created October 23, 2019 05:48
NativeScript Vue example
<template>
<GridLayout rows="30, auto" marginBottom="5">
<Label ref="label" row="1" :text="placeholder" opacity="0.4"
fontSize="14" class="input" />
<TextField ref="textField" :secure="secure" row="1" @focus="onFocus"
@blur="onBlur" borderBottomWidth="3" borderBottomColor="#cec8c8"
padding="0" />
</GridLayout>
</template>
@happychallenge
happychallenge / Api.js
Last active September 25, 2019 03:23
Vuex Axios 를 이용한 Todo List 개발
import axios from 'axios'
export default() => {
return axios.create({
baseURL: `http://jsonplaceholder.typicode.com/`,
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
}
})
@happychallenge
happychallenge / Login.vue
Created September 22, 2019 02:31
Vuex Axios 사용 예제
<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">
@happychallenge
happychallenge / Login.vue
Created September 22, 2019 02:28
Vue Axios를 통한 로그인
<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>
@happychallenge
happychallenge / g2b_crawling.py
Created September 22, 2019 02:25
나라장터 정부 Selenium 을 통한 크롤링
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):
from dal import autocomplete
from django import forms
from .models import Sales
class SalesForm(forms.ModelForm):
class Meta:
model = Sales
fields = ['name', 'customer']
widgets = {
{% 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>
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)
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) {