Skip to content

Instantly share code, notes, and snippets.

@askcompany-kr
askcompany-kr / README.md
Last active March 25, 2020 10:20
코로나바이러스감염증-19 페이지에 대한 파이썬/Pandas 크롤링 샘플
@askcompany-kr
askcompany-kr / RotatingImageFramerX.tsx
Created March 21, 2020 15:16
Framer X 샘플 컴포넌트. 클릭할 때마다 45%회전하여 scale이 변경하며, 이미지까지 변경됩니다.
import * as React from "react"
import { Frame, addPropertyControls, ControlType, useCycle } from "framer"
// Open Preview: Command + P
// Learn more: https://framer.com/api
const imageUrls = [
"https://images.unsplash.com/photo-1526047932273-341f2a7631f9?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1400&q=80",
"https://images.unsplash.com/photo-1533907650686-70576141c030?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1500&q=80",
]
host = '...'
user = '…'
name = '…'
password = '…'
import MySQLdb
db = MySQLdb.connect(host, user, password, name)
cursor = db.cursor()
@askcompany-kr
askcompany-kr / public-mask.ipynb
Last active March 11, 2020 08:00
공적마스크 데이터를 파이썬으로 가져와서 Pandas로 살짝 살펴보기
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import {useState} from "react";
// 출처: https://usehooks.com/useLocalStorage/
export default function useLocalStorage(key, initialValue) {
// State to store our value
// Pass initial state function to useState so logic is only executed once
const [storedValue, setStoredValue] = useState(() => {
try {
import requests
from bs4 import BeautifulSoup
res = requests.get("http://naver.com")
html = res.text
soup = BeautifulSoup(html, 'html.parser')
tag_list = soup.select('.PM_CL_realtimeKeyword_rolling .ah_k')
for rank, tag in enumerate(tag_list, 1): # 항상 하위 block 전에 콤마(:)를 씁니다.
label = tag.text
@askcompany-kr
askcompany-kr / ep01-01-pure-django.py
Last active July 17, 2019 18:28
[Ask Company] django-rest-framework를 활용한 HTTP API 서버 만들기, 예시 코드
#
# myapp/models.py
#
from django.db import models
class Post(models.Model):
message = models.TextField()
#