$ 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"持續新增
| {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'}, |
| #!/usr/bin/env bash | |
| # Requirements: | |
| # Node.js, curl, sed, grep | |
| # Usage: | |
| # ./putlocker.sh <video_url> <quality> <filename> | |
| showjs="/tmp/show.js" | |
| if [ ! -f "$showjs" ]; then |
| let _try_catch = macro { | |
| rule { catch ($e:ident) { $body ...} } => { | |
| { | |
| let $e = __e; | |
| $body ... | |
| return; | |
| } | |
| } | |
| rule { catch ($e:ident if $c:expr) { $body ...} } => { | |
| { |