Skip to content

Instantly share code, notes, and snippets.

View dfang's full-sized avatar
🎯
Focusing

fang duan dfang

🎯
Focusing
View GitHub Profile
@dfang
dfang / traefik.md
Last active August 1, 2019 16:00
simple demo on routing cross namespace by traefik ingress, docker for mac

create 2 services in 2 namespaces, and expose them

kubectl create ns t1
kubectl create ns t2
kubectl run hello-nginx --image=nginx --port=80 -n t1
kubectl run hello-nginx --image=nginx --port=80 -n t2
kubectl expose deployment hello-nginx --port=80 -n t1
kubectl expose deployment hello-nginx --port=80 -n t2
// ==UserScript==
// @name JDWL(京东大家电----订单一键导出)
// @namespace Violentmonkey Scripts
// @version 0.0.4
// @homepage https://github.com/dfang/userscript
// @homepageURL https://gist.github.com/dfang/21cb975506155e43f8eadf013636245d
// @description try to make partner.dhc.jd.com more user friendly!
// @author fang duan
// @include *partner.dhc.jd.com*
// @grant GM_notification
@dfang
dfang / psql_useful_stat_queries.sql
Created July 4, 2019 08:19 — forked from anvk/psql_useful_stat_queries.sql
List of some useful Stat Queries for PSQL
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB.
------------
-- Basics --
------------
-- Get indexes of tables
@dfang
dfang / ldflags.md
Last active June 6, 2019 01:07 — forked from ceccode/README.md
Go build LDFlags

Using the -ldflags parameter can help set variable values at compile time.

Using the example provided here:

  1. Running make build will create a build executable. Running it will result in:
$> ./build
no version (Mon YYYY)
$>

go get golang.org/x 包失败解决方法


由于限制问题,国内使用 go get 安装 golang 官方包可能会失败,如我自己在安装 collidermain 时,出现了以下报错:

$ go get collidermain
package golang.org/x/net/websocket: unrecognized import path "golang.org/x/net/websocket" (https fetch: Get https://golang.org/x/net/websocket?go-get=1: dial tcp 216.239.37.1:443: i/o timeout)

不翻墙的情况下怎么解决这个问题?其实 golang 在 github 上建立了一个镜像库,如 https://github.com/golang/net 即是 https://golang.org/x/net 的镜像库

@dfang
dfang / ssr.txt
Last active April 30, 2019 02:26
c3M6Ly9ZV1ZoWkY5amFHRmphR0V5TUY5d2IyeDVNVE13TlRwV04waFFURkZXVFZCRmVWWnpSRWh5UzJOaFRtcDNiMmxBTkRjdU5USXVNak11TVRjNE9qRTFNREF3I2hrMQpzczovL1kyaGhZMmhoTWpBdGFXVjBaanBXTjBoUVRGRldUVkJGZVZaelJFaHlTMk5oVG1wM2IybEFORGN1TlRJdU1qTXVNVGM0T2pFME9UazUjaGsyCnNzOi8vWVdWekxUSTFOaTFqWm1JNlZqZElVRXhSVmsxUVJYbFdjMFJJY2t0allVNXFkMjlwUURRM0xqVXlMakl6TGpFM09Eb3hNakl5TWc9PSNoazMKc3NyOi8vTkRjdU5USXVNak11TVRjNE9qRTJPVFk1T21GMWRHaGZjMmhoTVY5Mk5EcGphR0ZqYUdFeU1EcDBiSE14TGpKZmRHbGphMlYwWDJGMWRHZzZXVmR3ZW1GSFVtMWhha1UwVFdwUk0wOUViRUZKZVZKQlZUQkdhMXB0WXowCnNzcjovL05USXVNVGswTGpJeE9TNHhOams2TVRZNU5qazZZWFYwYUY5emFHRXhYM1kwT21Ob1lXTm9ZVEl3T25Sc2N6RXVNbDkwYVdOclpYUmZZWFYwYURwWlYzQjZZVWRTYldGcVJUUk5hbEV6VDBSc1FVbDVVa0ZWTUVacldtMWpQUQ==
@dfang
dfang / Mac OSX Setup - Brew
Created March 31, 2019 15:30 — forked from jbelke/Mac OSX Setup - Brew
Mac OSX Setup - Brew and Cask
# Get Sudo.
if [ $EUID != 0 ]; then
sudo "$0" "$@"
exit $?
fi
# Install Xcode first - https://itunes.apple.com/us/app/xcode/id497799835?ls=1&mt=12
# Install Xcode command line tools.
xcode-select --install
package main

import (
    "fmt"
    "os"
    "os/signal"
    "time"

 "github.com/robfig/cron"
@dfang
dfang / Fastfile
Created December 19, 2018 13:28 — forked from candostdagdeviren/Fastfile
Android Fastfile Example for Flutter application Fastlane integration
default_platform(:android)
platform :android do
desc "Submit a new QA Build to Crashlytics Beta"
lane :qa do
crashlytics(
api_token: 'CRASHLYTICS_API_TOKEN',
build_secret: 'CRASHLYTICS_BUILD_SECRET',
notes_path: 'qa-change.log',