This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
normal_regex = '[$|£]\s*\S+\s*(?:million)?' | |
def tmp(b): | |
# ['$910,0001955 ', '$350,000 '] | |
normal = re.findall(normal_regex, b) | |
return normal | |
def cal_average_budget(budget_list): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
curl -H 'Host: mall-store.xsyxsc.com' -H 'accept: application/json, text/plain, */*' -H 'content-type: application/x-www-form-urlencoded' -H 'accept-language: en-us' -H 'user-agent: Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.14(0x17000e2e) NetType/WIFI Language/en' -H 'referer: https://servicewechat.com/wx6025c5470c3cb50c/312/page-frame.html' --data-binary "mapX=114.047012&mapY=22.696412" --compressed 'https://mall-store.xsyxsc.com/mall-store/store/getNearStoreList' | |
*/ | |
{ | |
"rspCode":"success", | |
"rspDesc":"", | |
"data":[ | |
{ | |
"storeId":66880000649923, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"rspCode":"success", | |
"rspDesc":"", | |
"data":[ | |
{ | |
"orgAreaId":43, | |
"orgAreaName":"湖南省", | |
"orgAreaFullName":"湖南省", | |
"cityCharCode":null, | |
"level":1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
curl -H 'Host: mall.xsyxsc.com' -H 'accept: application/json, text/plain, */*' -H 'content-type: application/json' -H 'origin: https://image.xsyxsc.com' -H 'referer: https://image.xsyxsc.com/item/cms/activityLandingPage/release/20210521/2021052114143131669-1.html?pageCode=2021052114143131669&storeId=66880000772786&storeName=%E5%85%B4%E7%9B%9B%E4%BC%98%E9%80%89%E7%81%BC%E7%8E%89%E5%BA%97&cityCode=3502&areaCode=350203&provinceCode=35&channelUse=WXAPP&saleRegionCode=112&isReport=true&userKey=&v=1.2&isIphoneX=false&t=1621610989604' -H 'userkey: ' -H 'accept-language: en-us' -H 'user-agent: Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.14(0x17000e2e) NetType/WIFI Language/en miniProgram' --data-binary '{"windowName":"十点爆款","areaId":"112","storeId":"66880000772786","includeStoreGroup":true}' --compressed 'https://mall.xsyxsc.com/cms/queryLandingPageProduct' | |
*/ | |
{ | |
"success": true, | |
"data": [{ | |
"cmsIndexProductDto": { | |
"prId": 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://ponyfoo.com/articles/es6#introduction | |
> [a, , b] = [0,1,2] | |
[ 0, 1, 2 ] | |
> a | |
0 | |
> b | |
2 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// why uses vuex? | |
// because it's easier to track changes | |
const sourceOfTruth = {} | |
const vmA = new Vue({ | |
data: sourceOfTruth | |
}) | |
const vmB = new Vue({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://scotch.io/tutorials/implementing-authentication-in-nuxtjs-app | |
// https://github.com/vuejs/vue-hackernews-2.0 | |
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> | |
<div id='app'> | |
{{message}} | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// different hooks: | |
// - created | |
// - mounted | |
// - updated | |
// - destoryed | |
new Vue({ | |
data: { | |
a: 1 | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import logging | |
import Image | |
from StringIO import StringIO | |
MAX_THUMBNAIL_WIDTH = 320. | |
THUMBNAIL_DIR = 'thumbnails' | |
IMG_REG_URL = re.compile(r'"(http://s7.jcrew.com/is/image/.*?)\"') | |
JCREW_URL = 'http://www.jcrew.com/womens_category/shoes.jsp?iNextCategory=-1' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Image | |
def create_thumbnail(old_path, new_path): | |
img = Image.open(old_path) | |
img.thumbnail((200, 200), Image.ANTIALIAS) | |
img.save(new_path) |