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
{ | |
"openapi": "3.0.0", | |
"info": { | |
"description": "### 相關說明:\n* 目前僅提供最近一年數據\n* 日期時間格式為GMT+0", | |
"version": "0.1.0", | |
"title": "Taiwan Stock Holding Distribution API", | |
"contact": { | |
"email": "development@fugle.tw" | |
}, | |
"license": { |
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 crypto = require("crypto") | |
function encrypt(key, data) { | |
var cipher = crypto.createCipher('aes-256-cbc', key); | |
var crypted = cipher.update(text, 'utf-8', 'hex'); | |
crypted += cipher.final('hex'); | |
return crypted; | |
} |
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
' # Show developer tab in Excel: | |
' https://spreadsheeto.com/developer-tab/ | |
' # This vba example opens IE with finance.yahoo.com website, auto clicks "Quarterly" button, and then copies all td values | |
' of financial report into "Sheet1" sheet. | |
' # Can possibly use HTTP Request alternatively: http://excelerator.solutions/2017/08/28/excel-http-get-request/ (instead of open ie) | |
Sub test() | |
Dim RowCount As Integer | |
Dim sht As Worksheet |
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 collectionNames = db.getCollectionNames(), stats = []; | |
collectionNames.forEach(function (n) { stats.push(db[n].stats()); }); | |
stats = stats.sort(function(a, b) { return b['size'] - a['size']; }); | |
for (var c in stats) { print(stats[c]['ns'] + ": " + stats[c]['size'] + " (" + stats[c]['storageSize'] + ")"); } |
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
// ==UserScript== | |
// @name New Userscript | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://www.fugle.tw/picture/cards?cards[]={%22c%22:%22FCRD000002%22,%22s%22:%222330%22} | |
// @grant none | |
// ==/UserScript== |
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
#!/bin/bash | |
export NEW_SSH_KEY=ssh-rsa\ ....\ user@host | |
sed -e "s#ssh-rsa.*OLD_KEY_ID#$NEW_SSH_KEY#" ~/.ssh/authorized_keys | |
# ssh root@host 'bash -s' < this_script.sh |
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 puppeteer = require('puppeteer'); | |
(async () => { | |
const browser = await puppeteer.launch(); | |
const page = await browser.newPage(); | |
await page.goto('https://www.fugle.tw/picture/cards?cards[]={"c":"FCRD000002","s":"2330"}'); | |
await page.waitForSelector('line.candle-stem'); | |
await page.addScriptTag({ | |
content: ` | |
d3.selectAll(".candleRect").each(function(d,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
mongoose schema: | |
update: function(row){ | |
return this.update({}, row).exec(); | |
} | |
// method 1 | |
batchUpdate: function(rows){ | |
return Promise.map(rows, function(row){ | |
return self.update({}, row).exec(); |
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
console.log(angular); |
NewerOlder