$ go run cmd/main.go
// cmd/main.go
package main
import (
"github.com/poying/tmp/foo"
$ go run cmd/main.go
// cmd/main.go
package main
import (
"github.com/poying/tmp/foo"
#!/usr/bin/env bash | |
set -e | |
echo "mode: atomic" > coverage.txt | |
for d in $(go list ./... | grep -v vendor); do | |
go test -race -timeout=5s -coverprofile=profile.out -coverpkg=./... -covermode=atomic $d | |
if [ -f profile.out ]; then | |
cat profile.out | grep -v '^mode' >> coverage.txt | |
rm profile.out |
const path = require('path'); | |
const memwatch = require('memwatch-next'); | |
const heapdump = require('heapdump'); | |
const logger = require('./logger'); | |
const settings = require('./config/settings'); | |
memwatch.on('leak', info => { | |
const filepath = path.resolve(settings.HEAP_SNAPSHOT_DIR, Date.now() + '.heapsnapshot'); | |
logger.fatal({ leak: info }, 'Memory leak'); | |
heapdump.writeSnapshot(filepath, err => { |
YQL 查詢歷史資料
select * from yahoo.finance.historicaldata where symbol = "2498.TW" and startDate = "2016-01-01" and endDate = "2016-05-01"
port
不能使用 ADT,所以任何有巢狀結構的的資料在 port
都會遇到問題。目前的解法是在 outcome 的地方先用 JSON.stringify
轉成 String
,income 再用 JSON.parse
轉成 Maybe a
(噴 error 的時候就是 Nothing
,這個解法有點問題,暫時先這樣 :p)
const callbacks = {};
let callbackId = 0;
glbale.electron = window.electron = function (event, args, cb) {
// 產生 id 是為了讓之後 done 事件被觸發時能夠找到對應的 callback function
{url:'stun:stun01.sipphone.com'}, | |
{url:'stun:stun.ekiga.net'}, | |
{url:'stun:stun.fwdnet.net'}, | |
{url:'stun:stun.ideasip.com'}, | |
{url:'stun:stun.iptel.org'}, | |
{url:'stun:stun.rixtelecom.se'}, | |
{url:'stun:stun.schlund.de'}, | |
{url:'stun:stun.l.google.com:19302'}, | |
{url:'stun:stun1.l.google.com:19302'}, | |
{url:'stun:stun2.l.google.com:19302'}, |
'use strict'; | |
var utils = module.exports = {}; | |
utils.args = function (defval, names) { | |
defval || (defval = {}); | |
names || (names = []); | |
var map = {}; |
Object.getPropertyDescriptor || (Object.getPropertyDescriptor = function (obj, name) { | |
var desc; | |
while (obj) { | |
desc = Object.getOwnPropertyDescriptor(obj, name); | |
if (desc) { | |
desc.configurable = true; | |
return desc; | |
} | |
obj = Object.getPrototypeOf(obj); | |
} |