Skip to content

Instantly share code, notes, and snippets.

View yookoala's full-sized avatar

Koala Yeung yookoala

  • Pixel Action Studio
  • Hong Kong
  • 07:11 (UTC +08:00)
View GitHub Profile
func merge(cs ...<-chan int) <-chan int {
out := make(chan int)
var cases []reflect.SelectCase
for _, c := range chans {
cases = append(cases, reflect.SelectCase{
Dir: reflect.SelectRecv,
Chan: reflect.ValueOf(c),
})
}
@yookoala
yookoala / example.php
Last active June 16, 2019 15:25 — forked from hklcf/Screenshot via Google PageSpeed API
Screenshot via Google PageSpeed API
<?php
include_once 'getGooglePageSpeedScreenshot.php';
echo getGooglePageSpeedScreenshot($_GET['url']);
// Output: <img src="..." border="1" style="width: 80px; height: 80px" />
echo getGooglePageSpeedScreenshot($_GET['url'], [
'class' => 'thumbnail',
'style' => ['width: 80px;', 'height: 80px;']