Skip to content

Instantly share code, notes, and snippets.

@jemygraw
jemygraw / gzip.go
Last active December 6, 2016 09:32
package main
import (
"compress/gzip"
"github.com/qiniu/log"
"io"
"os"
)
func main() {
@jemygraw
jemygraw / qiniu-cdn-log-split.java
Last active December 16, 2016 10:08
qiniu-cdn-log-split.java
package com.qiniu.hadooplearn.play;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class StringTokenPlay {
@jemygraw
jemygraw / AES.java
Created December 15, 2015 05:18
aes of java
package net.duokr;
import java.security.Key;
import java.security.NoSuchAlgorithmException;
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
/**
@jemygraw
jemygraw / ImageComp_Std.java
Created December 3, 2015 02:00
standard image composition ufop code
package com.qiniulab.ufop;
import java.util.ArrayList;
import java.util.List;
import com.qiniu.common.QiniuException;
import com.qiniu.processing.OperationManager;
import com.qiniu.util.Auth;
import com.qiniu.util.StringMap;
import com.qiniu.util.UrlSafeBase64;
@jemygraw
jemygraw / go_make_efficiency.go
Last active November 30, 2015 03:00
go make efficiency
package main
import (
"fmt"
"time"
)
func main() {
msg := "i love golang, which will donimate the next generation of cloud service"
limit := 10000000
@jemygraw
jemygraw / ImageComp.java
Created November 19, 2015 01:17
create image composition and generate the webvtt file
package com.qiniulab.ufop;
import java.util.ArrayList;
import java.util.List;
import com.qiniu.common.QiniuException;
import com.qiniu.processing.OperationManager;
import com.qiniu.util.Auth;
import com.qiniu.util.StringMap;
import com.qiniu.util.UrlSafeBase64;
@jemygraw
jemygraw / id.go
Created October 13, 2015 08:10 — forked from jordanorelli/id.go
fast unique id generation in Go
package main
import (
"crypto/md5"
"encoding/binary"
"fmt"
"os"
"sync/atomic"
"time"
)
@jemygraw
jemygraw / image_composition.go
Created September 22, 2015 08:33
image composition in go
package main
import (
"fmt"
"image"
"image/draw"
"image/jpeg"
"image/png"
"os"
)
@jemygraw
jemygraw / m3u8_domain_replace.go
Created August 4, 2015 05:04
replace the domain in the m3u8 files
package main
import (
"bufio"
"flag"
"fmt"
"os"
"path/filepath"
"strings"
)
@jemygraw
jemygraw / sh_get_content_length_by_head_request.sh
Created July 16, 2015 10:29
shell - get the file content length via http HEAD request
curl -Is 'http://dbsq-video-base.oss-cn-qingdao.aliyuncs.com/base/1167_9da187a7a191431db943a9a5a6fec6f4.mp4' | grep 'Content-Length' | awk -F ': ' '{print $2}'