Skip to content

Instantly share code, notes, and snippets.

View dinos80152's full-sized avatar

Dino Lai dinos80152

View GitHub Profile
<?php
interface Info
{
public function channelMessage();
}
abstract class Live
{
const RANGE = 10;
protected $point = 0;
@zhang0098
zhang0098 / gbkbig5.go
Last active September 14, 2022 13:32
Golang GBK Big5 from/to UTF-8 转换
import (
"bytes"
"io/ioutil"
"golang.org/x/text/encoding/traditionalchinese"
"golang.org/x/text/encoding/simplifiedchinese"
"golang.org/x/text/transform"
)
//convert GBK to UTF-8
func Decodegbk(s []byte) ([]byte, error) {
I := bytes.NewReader(s)
@patchin
patchin / urlshort.go
Last active June 15, 2017 20:18
Go example of working with google api url shortener.
// Follow instructions here to create credentials to access google api shortener service:
// https://developers.google.com/identity/protocols/application-default-credentials
// I set the env variable GOOGLE_APPLICATION_CREDENTIALS with the path of the json credential file.
package main
import (
"fmt"
"golang.org/x/net/context"
"golang.org/x/oauth2/google"
anonymous
anonymous / AidConverter.java
Last active November 7, 2018 14:03
import com.google.common.base.Splitter;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
import com.ihad.ptt.model.bean.AidBean;
import org.apache.commons.lang3.StringUtils;
import java.util.List;
/**
* 文章編號與檔案名稱轉換工具<br />
@gene1wood
gene1wood / all_aws_lambda_modules_python.md
Last active May 25, 2024 20:06
AWS Lambda function to list all available Python modules for Python 2.7 3.6 and 3.7
@aczietlow
aczietlow / selenium-php-webdriver-cheatsheet.md
Last active March 6, 2024 22:48 — forked from huangzhichong/selenium-webdriver-cheatsheet.md
Cheat sheet for using php webdriver (facebook/webdriver).

Webdriver PHP API workthough

  • Open a browser

    # start an instance of firefox with selenium-webdriver
    
    $browser_type = 'firefox'
    $host = 'http://localhost:4444/wd/hub'
    

$capabilities = array(\WebDriverCapabilityType::BROWSER_NAME => $browser_type);

@drewolson
drewolson / reflection.go
Last active November 20, 2023 09:39
Golang Reflection Example
package main
import (
"fmt"
"reflect"
)
type Foo struct {
FirstName string `tag_name:"tag 1"`
LastName string `tag_name:"tag 2"`
@loonies
loonies / 1_phpunit-api.md
Last active January 19, 2024 07:34
PHPUnit Cheat Sheet

PHPUnit API reference

  • version 3.6

TODO

Check those constraints:

$this-&gt;anything()