This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
| // This is from my comment here: http://wolfram.kriesing.de/blog/index.php/2008/javascript-remove-element-from-array/comment-page-2#comment-466561 | |
| /* | |
| * How to delete items from an Array in JavaScript, an exhaustive guide | |
| */ | |
| // DON'T use the delete operator, it leaves a hole in the array: | |
| var arr = [4, 5, 6]; | |
| delete arr[1]; // arr now: [4, undefined, 6] |