Skip to content

Instantly share code, notes, and snippets.

View sujinleeme's full-sized avatar
🏃‍♀️
�CPH marathon

Sujin Lee sujinleeme

🏃‍♀️
�CPH marathon
View GitHub Profile
# beautiful Soup 한국어 인코딩 문제
# -*- coding: utf-8 -*-
import sys
import urllib.request
import re
from bs4 import BeautifulSoup
content = urllib.request.urlopen("http://www.roadrun.co.kr/schedule/view.php?no=6198")
soup = BeautifulSoup(content.read().decode('euc-kr', 'ignore'), 'html.parser')
print(soup)
# beautiful Soup 한국어 인코딩 문제
# -*- coding: utf-8 -*-
import sys
import urllib.request
import re
from bs4 import BeautifulSoup
content = urllib.request.urlopen("http://www.roadrun.co.kr/schedule/view.php?no=6198")
soup = BeautifulSoup(content.read().decode('euc-kr', 'ignore'), 'html.parser')
print(soup)
import requests
from bs4 import BeautifulSoup
read=requests.get('http://www.roadrun.co.kr/schedule/view.php?no=6198')
read.encoding = 'euc-kr'
soup = BeautifulSoup(read.content, 'html.parser')
table = soup.find_all('table')[1])
info = [s.strip() for s in table.text.splitlines() if s]
info = list(filter(None, info))[1::2]
info[11:len(info)] = [' '.join(info[11:len(info)])]
@sujinleeme
sujinleeme / gulpfile.js
Last active February 6, 2020 05:21
gulpfile.js for Django
var gulp = require('gulp');
var sass = require('gulp-sass');
var browserSync = require('browser-sync').create();
var exec = require('child_process').exec;
gulp.task('sass', function() {
return gulp.src('myblog/static/scss/**/*.scss')
.pipe(sass())
.pipe(gulp.dest('myblog/static/css'))
.pipe(browserSync.reload({
// 1. the sum of digits for one credit card number
function sumCard(num) {
// get number and change to integer
var num = num.match(/\d/g).map(Number);
// find the sum of an array of numbers
var sum = num.reduce((a, b) => a + b, 0);
return sum
}
// 2. get credit card number has the last largest sum of digits
@sujinleeme
sujinleeme / Vector2D.js
Last active September 7, 2017 01:47
JavaScript 2D Vector Class
class Vector {
constructor(v, w) {
this.v = v
this.w = w
this.decimalPlaces = 2
this.sign = {
add : '+',
subtract: '-',
multiply: '*',
@sujinleeme
sujinleeme / Vector2D.js
Created September 3, 2017 03:39
JavaScript 2D Vector Class
/*
Simple 2D JavaScript Vector Class
Sujin Lee
*/
class Vector {
constructor(v, w) {
@sujinleeme
sujinleeme / 2d-basic-vector-operations.js
Last active September 22, 2017 08:46
Simple 2D Vector Operation Class
/**
Simple 2D Vector Operation calculator Class using Javascript
Blog Post : https://www.sujinlee.me/blog/vector-basics/
*/
class Vector {
constructor(v, w) {
this.u = v
this.w = w
this.decimalPlaces = 2
@sujinleeme
sujinleeme / learnPromise.js
Last active November 11, 2017 08:17
learnPromise.js
const mapDispatchToProps = (dispatch) => {
return {
deleteCommentBodyContent: (id, category, parentId) => {
dispatch(deleteCommentContent(id))
.then(() => dispatch(getComments(parentId)))
}
}
// actions
@sujinleeme
sujinleeme / README.md
Created March 30, 2018 13:46 — forked from akashnimare/README.md
A Beginners Guide to writing a Kickass README ✍

Project title

A little info about your project and/ or overview that explains what the project is about.

Motivation

A short description of the motivation behind the creation and maintenance of the project. This should explain why the project exists.

Build status

Build status of continus integration i.e. travis, appveyor etc. Ex. -

Build Status