Skip to content

Instantly share code, notes, and snippets.

View azhai's full-sized avatar
🪁
Focusing

azhai

🪁
Focusing
View GitHub Profile
@azhai
azhai / curl_redirect_upload.php
Last active October 22, 2020 07:49 — forked from shierw/cURL转发文件上传.php
cURL转发文件上传
<?php
$uploadUrl = 'http://test.com/upload.php';
// 转发从其它客户端上传的文件,上传时字段name="file",但接收方字段name="attachment"
redirect_upload($uploadUrl, 'attachment', $_FILES['file']);
/*
* 转发上传文件
*/
function redirect_upload($url, $field = 'file', $file = null)
@azhai
azhai / decorator.go
Created August 29, 2019 02:14 — forked from saelo/decorator.go
Decorators in Go
package main
import (
"fmt"
"reflect"
)
func Decorate(impl interface{}) interface{} {
fn := reflect.ValueOf(impl)
@azhai
azhai / install-parallel-centos-6.sh
Created November 19, 2015 07:14 — forked from bzz/install-parallel-centos-6.sh
Install GNU Parallel on CentOS 6
#!/bin/bash
# Install parallel on CentOS 6.
# Assumes you are root. Prefix w/ sudo if not.
cd /etc/yum.repos.d/
#wget http://download.opensuse.org/repositories/home:tange/CentOS_CentOS-5/home:tange.repo
wget http://download.opensuse.org/repositories/home:/tange/CentOS_CentOS-6/home:tange.repo
yum install parallel