Skip to content

Instantly share code, notes, and snippets.

View CodeMath's full-sized avatar
๐ŸŽฏ
Focusing

codemath CodeMath

๐ŸŽฏ
Focusing
  • Seoul, Korea
View GitHub Profile
@CodeMath
CodeMath / naver_cafe_sellenium.py
Created October 6, 2017 06:25
๋„ค์ด๋ฒ„ ์นดํŽ˜ ๊ธ€ ์ž‘์„ฑ - ํŒŒ์ด์ฌ ์…€๋ ˆ๋Š„
#-*- coding: utf-8 -*-
import urllib2
import json
import requests
import ast
import time
from selenium import webdriver
from selenium.webdriver.support.ui import Select
from datetime import datetime
@CodeMath
CodeMath / django_settings_and_url_views.py
Created June 9, 2017 05:02
Django Test build about settings,views,urls, etc
"""
Django version 1.9.2
blog
โ””โ”€โ”€โ”€ templates
โ””โ”€โ”€โ”€ web
โ””โ”€โ”€โ”€index.html
โ””โ”€โ”€โ”€ web
โ””โ”€โ”€โ”€urls.py (์ƒˆ๋กœ ์ถ”๊ฐ€๋จ)
โ””โ”€โ”€โ”€ blog
@CodeMath
CodeMath / appdelegate.swift
Last active May 24, 2017 04:04
prepare in AppDelegate by Swift 3.0
/***
When get fcm data, set rootviewcontroller that order by Tabbar -> Navaigation -> (Segue) -> view
***/
// AppDelegate.swift
let TabBarViewController : UITabBarController = mainStoryboard.instantiateViewController(withIdentifier: "mainView") as! UITabBarController
// NavigationController
let infoNavigation = mainStoryboard.instantiateViewController(withIdentifier: "infoNavigation") as! UINavigationController
let buystockNavigation = mainStoryboard.instantiateViewController(withIdentifier: "buystockNavigation") as! UINavigationController
/******************************************************************************
* This tutorial is based on the work of Martin Hawksey twitter.com/mhawksey *
* But has been simplified and cleaned up to make it more beginner friendly *
* All credit still goes to Martin and any issues/complaints/questions to me. *
******************************************************************************/
var TO_ADDRESS = "๋ฐ›๋Š” ์ฃผ์†Œ"; // change this ...
function doPost(e) {
// ๊ตณ์ด datas๋ผ๊ณ  ๋ณ€์ˆ˜๋กœ ์•ˆํ•ด๋„ ๋ฉ๋‹ˆ๋‹ค.
import datetime
from django.utils.timezone import utc
from rest_framework.authentication import TokenAuthentication
from rest_framework import exceptions
class ExpiringTokenAuthentication(TokenAuthentication):
def authenticate_credentials(self, key):
try:
token = self.model.objects.get(key=key)
#-*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.contrib.auth.models import User
class Counts(models.Model):
user_id = models.ForeignKey(User, on_delete=models.CASCADE)
numbers = models.IntegerField(default=0)
date = models.DateTimeField(auto_created=True, auto_now_add=True)