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
function isBottom(){ | |
var windowHeight = window.innerHeight | |
|| document.documentElement.clientHeight | |
|| document.body.clientHeight; | |
var scrollTop = $(window).scrollTop(); | |
var totalHeight = $(document).height(); | |
var percent = (windowHeight + scrollTop)/totalHeight; | |
if(percent === 1){ | |
return true; | |
}else{ |
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
var request = require('request'); | |
var API_URL = 'https://notify-api.line.me/api/notify'; | |
var token = 'TOKEN' | |
var message = '今天吃好料的' | |
var data = { | |
url: API_URL, | |
method: 'POST', | |
json: true, | |
headers: { | |
'User-Agent': 'Request-Promise', |
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
# Android | |
platforms/android/assets/www | |
platforms/android/bin/ | |
platforms/android/gen/ | |
platforms/android/res/xml/config.xml | |
# iOS | |
platforms/ios/build/ | |
platforms/ios/CordovaLib/build/ | |
platforms/ios/www |
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
git branch --merged | egrep -v "(^\*|master|develop|)" | xargs git branch -d |
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 React, { Component } from 'react'; | |
export default class Home extends Component { | |
render() { | |
return ( | |
<div id="pageHome"> | |
hi this is home page | |
</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
import React, { Component } from 'react'; | |
export default class Home extends Component { | |
componentDidMount(){ | |
// execute api here | |
} | |
render() { | |
return ( |
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
const getMyProfile = async() => { | |
try { | |
const response = await axios.get('/api/myProfile'); | |
return response.data; | |
} catch(e) { | |
throw e; | |
} | |
} |
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
const afterLogin = async() => { | |
const userProfile = await axios.get('/profileData'); | |
const menuData = await axios.get('/menuData'); | |
const dashboardData = await axios.get('/api/dashboard/xxxx'); | |
return { userProfile, menuData, dashboardData }; | |
} |
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
const afterLogin = async() => { | |
const datas = await Promise.all([ | |
axios.get('/profileData'), | |
axios.get('/menuData'), | |
axios.get('/api/dashboard/xxxx') | |
]); | |
return { | |
userProfile: datas[0], | |
menuData: datas[1], | |
dashboardData: datas[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
const selectSize = (size) => { | |
const selector = document.querySelector('#exp-pdp-buying-tools-container > form > div.exp-pdp-size-and-quantity-container > div > div.exp-pdp-size-dropdown-container.nsg-form--drop-down--option-container.selectBox-options.nsg-form--drop-down.exp-pdp-size-dropdown.exp-pdp-dropdown.two-column-dropdown.selectBox-dropdown-menu > ul'); | |
const children = Array.from(selector.children); | |
children.forEach(ele => { | |
const rel = ele.getAttribute('rel'); | |
if (rel.substring(rel.indexOf(':'), rel.length) === `:${size}`) { | |
console.log('find ele', ele); | |
$('select[name="skuAndSize"]').val(rel); | |
$('#buyingtools-add-to-cart-button').click(); | |
} |