Skip to content

Instantly share code, notes, and snippets.

yudppp yudppp

Block or report user

Report or block yudppp

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View app.go
package main
import (
"bytes"
"crypto/sha256"
"database/sql"
"encoding/json"
"errors"
"fmt"
"html/template"
@yudppp
yudppp / date.go
Last active Jun 15, 2018
Go date.Date
View date.go
package date
import (
"database/sql/driver"
"encoding/json"
"errors"
"fmt"
"time"
)
@yudppp
yudppp / Dockerfile
Last active Aug 17, 2017
kube job remover
View Dockerfile
FROM alpine
ENV KUBECTL_VERSION v1.5.3
ADD https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl /bin/kubectl
RUN chmod +x /bin/kubectl
# Delete successed job after 2 hours ago
CMD while true; do kubectl get job | awk '{ if(match($4, /^([2-9]h|[1-2][0-9]h|[0-9]+d)$/) && ($3==1)) print $1}' | xargs -n 1 --no-run-if-empty kubectl delete job; sleep 600s; done
@yudppp
yudppp / main.go
Created May 8, 2017
goduplication check
View main.go
package main
import (
"bufio"
"fmt"
"io"
"io/ioutil"
"os"
"path"
@yudppp
yudppp / mem.go
Last active Oct 7, 2015
use memcached go
View mem.go
package main
import (
"encoding/json"
"sync"
"github.com/bradfitz/gomemcache/memcache"
)
var once = &sync.Once{}
You can’t perform that action at this time.