Skip to content

Instantly share code, notes, and snippets.

View himulawang's full-sized avatar

ila himulawang

  • ila Empire
  • Shanghai
View GitHub Profile
@himulawang
himulawang / main.js
Created February 18, 2020 10:23
Headless Chrome Download Images
const puppeteer = require('puppeteer');
const fs = require("fs");
let crawlPage = async (url, pageID) => {
const browser = await puppeteer.launch({headless:true, });
const page = await browser.newPage();
// prevent
// TimeoutError: Navigation timeout of 30000 ms exceeded
await page.setDefaultNavigationTimeout(0);
@himulawang
himulawang / main.go
Created September 5, 2015 11:34
Go connect to non-cluster redis & mysql
package main
import (
"time"
log "github.com/Sirupsen/logrus"
"github.com/fzzy/radix/redis"
"github.com/fzzy/radix/extra/pool"
"github.com/jinzhu/gorm"
@himulawang
himulawang / main.go
Last active September 4, 2015 15:56
Golang Reflect New
package main
import (
"fmt"
"reflect"
)
func main() {
// one way is to have a value of the type you want already
a := 1
@himulawang
himulawang / reflect_performance.go
Created August 30, 2015 16:23
Go Reflect Performance
package main
import (
"fmt"
"time"
"reflect"
)
func TestReflect(a int64) {
var i int64