Skip to content

Instantly share code, notes, and snippets.

View jilieryuyi's full-sized avatar
🌴
On vacation

老中医 jilieryuyi

🌴
On vacation
View GitHub Profile
@jilieryuyi
jilieryuyi / imgrsz.go
Created January 20, 2021 03:57 — forked from logrusorgru/imgrsz.go
Golang resize png images using different interpolations
package main
import (
"image"
"image/png"
"log"
"os"
"time"
"golang.org/x/image/draw"
func Escape(sql string) string {
dest := make([]byte, 0, 2*len(sql))
var escape byte
for i := 0; i < len(sql); i++ {
c := sql[i]
escape = 0
switch c {
case 0: /* Must be escaped for 'mysql' */
func openbrowser(url string) {
var err error
switch runtime.GOOS {
case "linux":
err = exec.Command("xdg-open", url).Start()
case "windows":
err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start()
case "darwin":
err = exec.Command("open", url).Start()
@jilieryuyi
jilieryuyi / README.md
Created February 26, 2019 06:42 — forked from pcan/README.md
Compile Redis with Cygwin

Prerequisites

Install Cygwin with make, gcc & g++. Download Redis tar.gz package, unpack it.

Patch

Edit deps/hiredis/net.c and add the following lines just after the include directives: