Skip to content

Instantly share code, notes, and snippets.

View junhoyeo's full-sized avatar
🏴‍☠️

Junho Yeo junhoyeo

🏴‍☠️
View GitHub Profile
@junhoyeo
junhoyeo / quadratic-function-form-changer.py
Last active June 24, 2018 10:31
general form of quadratic function to standard form
# Converts the general form(`y=ax²+bx+c`) of the input quadratic function to the standard form(`y=a(x-p)²+q`) of the quadratic function.
# 일반형 이차함수를 입력받아 표준형 이차함수로 변형하여 출력한다.
# ex1> input : y=2x²-8x+7 => result : y=2(x-2)²-1
# ex2> input : y=-3x²+6x-5 => result : y=-3(x-1)²-2
print('y=ax²+bx+c')
a1 = int(input('a : '))
if a1 == 0:
print('not a vaild quadratic function')
@junhoyeo
junhoyeo / flask-googlemaps-tut.py
Last active December 15, 2021 12:07
simple flask googlemaps tutorial code with python flask
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
from flask import Flask, render_template, request
from flask_googlemaps import GoogleMaps, Map
# require Flask-GoogleMaps (https://github.com/rochacbruno/Flask-GoogleMaps)
app = Flask(__name__)
api_key = 'java-chip-frappuccino' # change this to your api key
# get api key from Google API Console (https://console.cloud.google.com/apis/)
@junhoyeo
junhoyeo / kakao-chatbot-tester.py
Created July 11, 2018 16:53
Test your kakaoTalk plusfriend chatbot app with only one line of Python code / 단 한 줄의 파이썬 코드로 당신의 카카오톡 챗봇을 바로 테스트하세요
print(__import__('requests').get(input('location of message.php on your server : '), json={'user_key': 'for-testing', 'type': 'text', 'content': input('content : ')}).text)
@junhoyeo
junhoyeo / cookie.php
Created July 17, 2018 19:06
one line code that farms cookie data(use in XSS PoC)
@junhoyeo
junhoyeo / korean-keyword-extracter.py
Created July 22, 2018 10:39
extract korean keywords from the web with Python3
import requests
from bs4 import BeautifulSoup
from krwordrank.hangle import normalize
from krwordrank.word import KRWordRank
from konlpy.tag import Hannanum
def parse(url):
print('\x1b[0;30;47mURL\x1b[0m : ' + url)
return keywords(requests.get(url).text)
import requests
from bs4 import BeautifulSoup
from krwordrank.hangle import normalize
from krwordrank.word import KRWordRank
from konlpy.tag import Hannanum
def parse(url):
return keywords(requests.get(url).text)
def parse_all(articles):
@junhoyeo
junhoyeo / careernet.md
Last active November 1, 2018 14:26
careernet

커리어넷의 직업정보에 등재되지 않은 직업은 학교생활기록부의 희망직업 란에 입력할 수 없다고요?

1. 2018학년도 학교생활기록부 기재요령 및 기타 교육부 문서

2018학년도 학교생활기록부 기재요령 78p 표준 가이드라인

‘진로희망’은 학생의 진로설계 및 변경 등을 고려하여 관심 분야나 희망 직업을 기재하고, ‘희망사유’ 에는 충분한 상담과 관찰을 통해 진로 희망 사유를 기재함.

※ 관심 분야나 희망 직업은 커리어넷(www.career.go.kr) 직업정보의 직업분류를 참고함.

@junhoyeo
junhoyeo / 도수분포표.py
Created October 23, 2018 09:46
도수분포표
import math
start, end, interval = (int(i) for i in input().split(' '))
f = [int(i) for i in input().split(' ')]
result = []
for idx, i in enumerate(range(start, end, interval)):
rank = (i*2+interval)/2
result.append([str(i) + ' ~ ' + str(i+interval), f[idx], rank, rank*f[idx]])
f_aver = sum([row[1] for row in result]) # 도수 평균
aver = sum([row[3] for row in result])/f_aver # 평균
for row in result:
@junhoyeo
junhoyeo / count_array_in_json_file.py
Last active December 12, 2018 13:20
JSON 문서 안 names 리스트의 정보 (지인분 도움)
import json
with open('something.json', 'r') as f:
data = json.load(f)
print(len(data['names'])) # 전체 names 리스트의 길이
kinds = []
for name in data['names']:
if name not in kinds:
print(name, data['names'].count(name)) # names 안의 한 name과 그 개수
kinds.append(name)