Skip to content

Instantly share code, notes, and snippets.

View shenjing023's full-sized avatar
🎯
Focusing

liuwei shenjing023

🎯
Focusing
  •  北京
View GitHub Profile
@shenjing023
shenjing023 / example.go
Created August 26, 2020 06:17
[Golang] os/exec 带超时 command
package main
import (
"log"
"os/exec"
"time"
)
func main() {
cmd := exec.Command("ping", "www.baidu.com")
@shenjing023
shenjing023 / rapunzel_moviepy.py
Created May 22, 2020 08:05 — forked from Zulko/rapunzel_moviepy.py
Tangled + MoviePy
"""
This creates the following GIF, where the text appears to be "embedded"
in the video and "disappears" behind rapunzel.
http://i.imgur.com/gxEHfLX.gif
"""
from moviepy.editor import *
import numpy as np
import skimage.morphology as skm
"""
An alternative text clip for Moviepy, relying on Gizeh instead of ImageMagick
Advantages:
- Super fast (20x faster)
- no need to install imagemagick
- full-vector graphic, no aliasing problems
- Easier font names
Disadvantages:
@shenjing023
shenjing023 / decorator.go
Created September 5, 2019 15:21 — forked from saelo/decorator.go
Decorators in Go
package main
import (
"fmt"
"reflect"
)
func Decorate(impl interface{}) interface{} {
fn := reflect.ValueOf(impl)