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 fetch = require('node-fetch'); | |
const fs = require('fs'); | |
const API = 'https://doting.tw'; | |
const PATH_ANIMAL_TYPE = "./animal-type.json"; | |
const PATH_ALL_ANIMALS = "./all-animals.json"; | |
/** | |
* 建立API需要的驗證資訊 | |
*/ |
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 cvt = require("xml-js"); | |
const fs = require("fs"); | |
let urlList = []; | |
["/","/page2","/page3"].forEach((router) => { | |
urlList.push({ | |
loc: `${BASE_URL}${router}`, | |
}); | |
}); |
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 decode(text) { | |
if (!text) | |
return ""; | |
//string to byte[] | |
let byteArr = []; | |
for (let i = 0; i < text.length; i++) { | |
byteArr.push(text.charCodeAt(i)); | |
} |
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 location="C:/Users/YOUR_NAME/AppData/Roaming/Mozilla/Firefox/Profiles/xxx.xxx"; | |
var sqlite3 = require('sqlite3').verbose(); | |
var db = new sqlite3.Database(location+'/places.sqlite'); | |
db.serialize(function () { | |
db.each("DELETE FROM moz_places WHERE visit_count <=2 AND last_visit_date < CAST(strftime('%s', datetime('2019-03-01')) AS INT)*1000000", | |
function (err, row) { | |
console.log(row); | |
} | |
); |
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
(7) | |
// 1 inch = 2.54cm | |
private static final float cmPerInch=1/2.54; | |
public float convertCmToInch(float cm){ | |
return cm*cmPerInch; | |
} | |
(8) | |
1. 沒頭沒尾 我根本不知道這是什麼method XD |