Skip to content

Instantly share code, notes, and snippets.

View neoneo40's full-sized avatar

neo neoneo40

  • Seoul, Korea
View GitHub Profile
@neoneo40
neoneo40 / README.md
Created April 8, 2016 14:28 — forked from allieus/README.md
네이버 블로그 크롤링

네이버 블로그 크롤링

  • 파이썬3 에서 동작합니다.
  • requests, beautifulsoup4 라이브러리가 필요합니다.
pip install requests beautifulsoup4

AskDjango

@neoneo40
neoneo40 / jumin.js
Created December 26, 2015 06:52 — forked from Luavis/jumin.js
대한민국 주민번호 확인 알고리즘
"use strict";
var input = '13자리의 주민번호 - 없이';
var mul = [2,3,4,5,6,7,8,9,2,3,4,5];
var sum = 0;
for(var i =0; i < mul.length; i++) {
var digit = parseInt(input[i]);
sum += digit * mul[i];
}
@neoneo40
neoneo40 / olleh_hack
Created December 26, 2015 06:37 — forked from Luavis/olleh_hack
change mac address for ollehWiFi
#!/bin/sh
if [ $# -eq 1 ]
then
if [ "$1" = "spoof" ]
then
sudo ifconfig en0 ether # Your iPhone MAC Adress
echo "spoof to iphone MAC address"
elif [ "$1" = "origin" ]
then
@neoneo40
neoneo40 / autopoker.py
Created December 26, 2015 06:34 — forked from Luavis/autopoker.py
한국인만 쓸 수 있는 페이스북 콕찔러보기 매크로
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import mechanize
import time
import os
import sys
from random import choice
import logging
@pytest.yield_fixture(scope='function', autouse=True)
def newline_before_logging(request):
if request.config.getoption('capture') == 'no':
print # new-line
yield
@neoneo40
neoneo40 / How_to_classify_between_return_and_instance_variable.py
Last active December 6, 2015 14:57
How to classify between return and instance variable?
import requests
from bs4 import BeautifulSoup
# No.1
class CrawlerWithReturn(object):
def __init__(self, url):
self.url = url
def get_page(self):
return requests.get(self.url)
# -*- coding: utf-8 -*-
__author__ = 'pr0ximo'
# 필독!
# 본 자료는 파이썬 교육을 위해 코드 활용의 목적을 위해서만 제작된 코드이며, 불법적인 용도로 사용될수 없습니다.
# 또한 본 코드의 불법적인 사용으로 인한 모든 법적또는 신체적/정신적 책임은 본 코드 제작자가 일절 책임지지 않습니다.
# 본자료는 로그인이 필요한 유료/무료 웹툰을 가져올수 없습니다.
# 또한 그걸 제공 해서 배포할 생각도 없습니다. ㅎ
#!/usr/bin/env python3
from urllib.parse import quote, unquote
str1 = '인코딩 제발ㅠㅠ'
str1.encode('euc-kr')
# b'\xc0\xce\xc4\xda\xb5\xf9 \xc1\xa6\xb9\xdf\xa4\xd0\xa4\xd0'
str_euckr = quote(str1.encode('euc-kr'))
str_euckr
# '%C0%CE%C4%DA%B5%F9%20%C1%A6%B9%DF%A4%D0%A4%D0'
@neoneo40
neoneo40 / Refactoring_question.md
Last active December 1, 2015 07:48
Refactoring question

Refactoring question

Extract Method

  • p.146
  • 책에서는 계속 임시 변수 사용을 줄이라고 하는데 왜 임시변수 사용을 줄여야 하는가?
  • 내가 보기에는 outstanding 이라는 임시변수를 만들어 놓으면 outstanding 임시변수만 수정하게 되면 편하게 get_outstanding의 매개변수를 변경할 수 있어서 편한다고 생각이 들고 이게 좀 더 소스코드를 읽기 좋다고 생각한다.
  • 책에서 말하는 refactoring을 하면 get_outstanding의 파라미터를 변경하려면 keyboard 키를 몇 번 더 움직여야 하고 직관적이지 못하다.