Skip to content

Instantly share code, notes, and snippets.

View Beomi's full-sized avatar

Junbum Lee Beomi

View GitHub Profile
#! /bin/bash
#
# Copyright 2014 Lucy Park
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import pandas as pd
import numpy as np
from mxnet.gluon import nn, rnn
from mxnet import gluon, autograd
@Beomi
Beomi / naver_kin_qa_per_url.py
Created February 26, 2019 07:41
네이버 지식인 URL 따라 질문/답변 받아오기
# coding: utf-8
import requests
from bs4 import BeautifulSoup as bs
def get_qa_from_url(url):
r = requests.get(url)
soup = bs(r.text, 'html.parser')
q_title = ' '.join(soup.select_one('h3.heading').text.split())
q_contents = ' '.join(soup.select_one('div.user_content').text.split())
@Beomi
Beomi / naver_kin.py
Created February 26, 2019 07:29
네이버 지식인 목록 불러오기
import requests
from bs4 import BeautifulSoup as bs
def get_naver_kin_urls(query, max_page=100):
page = 0
headers = {
'authority': 'm.search.naver.com',
'pragma': 'no-cache',
@Beomi
Beomi / isMacbookBuyOpen.py
Created August 3, 2018 07:00
맥북은 언제 판매되나여
import requests
res = requests.get('https://www.apple.com/kr_edu_5001245/shop/configUpdate/MR972KH/A?option.processor__dummy_z0v3=065-C6CJ&option.memory__dummy_z0v3=065-C6CP&option.hard_drivesolid_state_drive__dummy_z0v3=065-C6CT&option.keyboard_and_documentation_z0v3=065-C6GX&option.software_placeholder_1_z0v3=065-C171&product=MR972KH%2FA&step=config').json()['body']['replace']['summary']['shippingEstimate']
if res == '현재 구매 불가':
pass
else:
import telegram
bot = telegram.Bot(token='텔레그램봇토큰')
chat_id = 12341234 # 개인 채팅 ID
@Beomi
Beomi / lambda_function.py
Last active June 3, 2018 17:46
NexonTalk 20180605: DeepLearning with CNN on AWS Lambda
import torch #파이토치
import torchvision.datasets as vdatasets #데이터셋 모음
import torchvision.utils as vutils #유틸리티함수
import torchvision.transforms as vtransform #변환함수
import numpy as np #수치연산
import torch.nn as nn
import torch.nn.functional as F
from PIL import Image
from io import BytesIO
import base64
@Beomi
Beomi / troller.py
Created December 9, 2017 05:53
파이썬 2017 연말 세미나 트롤러
import requests
import time
from multiprocessing import Pool
def troll(_):
with requests.Session() as s:
s.headers = {
'DNT': '1',
'Accept-Encoding': 'gzip, deflate',
@Beomi
Beomi / iam_policy.json
Created August 1, 2017 00:52
Serverless Framework iam settings for AWS
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"cloudformation:CreateStack",
"cloudformation:DescribeStacks",
"cloudformation:DescribeStackEvents",
"cloudformation:DescribeStackResources",

우아한 테크캠프 웹트랙 2주차 1일 과제

Map, Filter같이 동작하는 함수 구현

// map function
const mapFunction = (array, func) => {
    const new_array = []
    for (i of array) {
        new_array.push(
@Beomi
Beomi / WhatIsDoubleEM.md
Created July 10, 2017 13:22
우아한 테크캠프 2주 1일차 과제: `map`/`filter`구현하기 | 어쩌다 JS는 JS가 되었나 | `!!`은 무엇인가

!!은 무엇인가?


JS에서의 !

JavaScript에서 !not의 의미이고, Bool 연산시 true -> false, false -> true로 변환해준다.

그리고 특정한 값 혹은 객체는 false와 동등하게 취급된다. 즉, if구문의 조건의 결과로 나올 경우 '', null, undefined, []등은 false로 취급되는 것이다.