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
require('chromedriver') | |
const seleniumWebdriver = require('selenium-webdriver') | |
const { By, until } = require('selenium-webdriver') | |
const { Options } = require('selenium-webdriver/chrome') | |
const options = new Options() | |
options.addArguments('--headless') | |
const driver = new seleniumWebdriver.Builder() | |
.forBrowser('chrome') | |
.setChromeOptions(options) |
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
#!/usr/bin/env node | |
require('shelljs/global'); | |
var filename = process.argv[2]; | |
// mediainfo --Output="Video;%Width%x%Height%" multiple-gradient.mov | |
var output = exec('mediainfo --Output="Video;%Width%x%Height%" ' + filename, {silent: true}).output | |
var matched = /(\d+)x(\d+)/.exec(output); |
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
let promises = [fetch('fileA.json'), fetch('fileB.json')]; | |
Promise.all(promises) | |
.then(values => Promise.all(values.map(val => val.json()))) | |
.then(results => { | |
console.log('fileA.json', results[0]); | |
console.log('fileB.json', results[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
require('shelljs/global'); | |
exec('git status') | |
.output | |
.split('\n') | |
.filter(line => line.trim().substr(0, 9) === 'modified:') | |
.map(line => line.substr(12)) | |
.forEach(file => exec(`git commit -m "Fixed lint warning in ${file}" -- ${file}`)); |
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
require('shelljs/global'); | |
var htmls = find('.').filter(file => file.match(/.html$/)); | |
var reporters = {}; | |
htmls.forEach(html => { | |
var content = cat(html); | |
var matched = content.match(/<h2 class="author-name">(.+)<p/); | |
if (matched) { | |
var name = matched[1].trim(); | |
reporters[name] = true; |
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
service: aws-nodejs | |
provider: | |
name: aws | |
runtime: nodejs4.3 | |
stage: beta | |
region: us-west-2 | |
package: | |
include: |
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
'use strict'; | |
require('dotenv').config(); | |
const fetch = require('node-fetch'); | |
const LineBot = require('line-bot-sdk'); | |
module.exports = { | |
receive(event, context, cb) { | |
const message = `postback ${event.body.result[0].content.text}`; |
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
星期六那個算法是組合技 | |
第一個是星期六加班怎麼算 | |
http://www.law119.com.tw/newdesign/compty2/lawnewsview.asp?idnostr=%B3%D2%A4u%A9e%AD%FB%B7%7C%A1G%A6%B3%C3%F6&idno=2474&keywords= | |
逾法定正常工作總時數者,應依該法第二十四條規定辦理。 | |
所以就是前兩小時加1/3 後兩小時加2/3 | |
再多法律沒規定 自己看著辦 | |
正常推論至少也是加2/3 | |
再加上另一個函釋把月薪制定成休憩日也有薪水 | |
所以星期六的前八小時原本就有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
() => { | |
total += current; | |
console.log('total: ' + total, ', current: ' + current); | |
return current !== 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
const articlesSelector = 'a.item_link.start_articleview'; | |
client | |
.elements('css selector', articlesSelector, function(array) { | |
current = array.value.length; | |
callback(); | |
}); |