Skip to content

Instantly share code, notes, and snippets.

View SoulSu's full-sized avatar
🎯
Focusing

soul SoulSu

🎯
Focusing
View GitHub Profile
@SoulSu
SoulSu / aesecb.go
Last active August 3, 2022 07:36
golang aes ecb pKCS5Padding like java 3DES_ECB_PKCS5Padding
package idcardocr
import (
"bytes"
"crypto/cipher"
"crypto/des"
)
// 3DES加密
@SoulSu
SoulSu / Jenkinsfile
Created August 14, 2018 13:26
Golang build with jenkins pipleline
node {
// 使用的Go版本号
def root = tool name: 'Go1103', type: 'go'
// 使用的第三方包目录
def sysGoVendorPath = "/opt/govendor"
// 系统编译目录
def projBuildPath = "${JENKINS_HOME}/jobs/${JOB_NAME}/builds/${BUILD_ID}/"
// 项目构建目录
def goBuildPath = "${projBuildPath}src/quoteserver/quotereal"
// 相对编译输出文件夹名称
@SoulSu
SoulSu / ping.php
Created July 13, 2017 15:06
简单实现的ping echo 程序
<?php
$host = "127.0.0.1";
$_type = chr(8);
$type = pack('c', 8);
$code = pack('c', 0);
@SoulSu
SoulSu / api.go
Created June 15, 2017 14:13
更优雅的关闭tcp链接
var tempDelay time.Duration
for {
conn, err := listener.Accept()
if err != nil {
if ne, ok := err.(net.Error); ok && ne.Temporary() {
if tempDelay == 0 {
tempDelay = 5 * time.Millisecond
} else {
tempDelay *= 2
}
@SoulSu
SoulSu / route.php
Created October 12, 2016 08:21
Laravel route
<?php
Route::group([], function () {
Route::any('/{controller?}/{action?}', function($controller='', $action=''){
if (empty($controller)) {
return 'welcome!';
}else {
$controller = "App\\Http\\Controllers\\".ucfirst($controller).'Controller';
return App::make($controller)->$action();
}
@SoulSu
SoulSu / squeue.go
Last active August 31, 2016 08:57
使用Golang 实现简单队列
package main
import (
"errors"
"fmt"
"log"
"runtime"
"sync"
"time"
)