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
// get wayPoints | |
for (let i = 0; i < trails.length; i++) { | |
// 選主路線 | |
await select(page, `${baseId}_climblinemain`, trails[i].value); | |
await page.waitForSelector(`a[title='${trails[i].name}']`); | |
const trail = trails[i]; | |
for (let j = 0; j < trail.subTrails.length; j++) { | |
const subTrail = trail.subTrails[j]; | |
// 選次路線 | |
await select(page, `${baseId}climbline`, subTrail.value); |
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 puppeteer = require("puppeteer"); | |
const fs = require("fs"); | |
const moment = require("moment"); | |
const _ = require("lodash"); | |
const baseId = "#ContentPlaceHolder1_"; | |
(async () => { | |
const browser = await puppeteer.launch(); | |
const page = await browser.newPage(); |
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
# https://stackoverflow.com/questions/15617016/cp-copy-all-files-with-a-certain-extension-from-all-subdirectories | |
find . -name \*.xls -exec cp {} newDir \; |
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
# Error: listen EADDRINUSE 0.0.0.0:3003 | |
# [ref](https://stackoverflow.com/questions/3855127/find-and-kill-process-locking-port-3000-on-mac) | |
lsof -t -i tcp:3003 | xargs kill | |
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 puppeteer = require("puppeteer"); | |
(async () => { | |
const browser = await puppeteer.launch(); | |
const page = await browser.newPage(); | |
await page.goto( | |
"https://npm.cpami.gov.tw/apply_1_2.aspx?unit=e6dd4652-2d37-4346-8f5d-6e538353e0c2" | |
); | |
await page.click("input[id='chk[]0']"); |
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
{ | |
"cx": { | |
"prefix": "cx", | |
"body": "className={cx('$1')}" | |
} | |
} |
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
[user] | |
name = yes | |
[alias] | |
acn = !git add . && git commit -n | |
fdr = !git fetch origin develop:develop && git rebase -i develop | |
bmd = !git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d // branch merged delete | |
gp = !git push origin HEAD // push current branch | |
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
package main | |
import ( | |
"context" | |
"log" | |
cdp "github.com/knq/chromedp" | |
) | |
func main() { |
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
{ | |
"name": "nightwatch_webcrawler", | |
"description": "A web crawler sample based on nightwatch.", | |
"version": "0.0.1", | |
"author": { | |
"name": "tonypai", | |
"email": "[email protected]" | |
}, | |
"homepage": "http://github.com/tpai", | |
"dependencies": { |
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
FROM ubuntu:16.04 | |
RUN apt-get update && apt-get install -y --no-install-recommends \ | |
ca-certificates \ | |
apt-transport-https \ | |
openjdk-8-jre-headless \ | |
curl \ | |
xz-utils \ | |
unzip \ | |
bzip2 \ |