Skip to content

Instantly share code, notes, and snippets.

View dfang's full-sized avatar
🎯
Focusing

fang duan dfang

🎯
Focusing
View GitHub Profile
@candostdagdeviren
candostdagdeviren / Fastfile
Last active October 8, 2024 07:35
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',
@fwindpeak
fwindpeak / jd_autobuy.js
Last active December 11, 2020 12:55
userscript for auto buy jd.com item
// ==UserScript==
// @name jd_autobuy
// @namespace http://fwindpeak.github.com
// @version 0.0.1
// @description autobuy jd item
// @author fwindpeak
// @match *://item.jd.com/*.html*
// @match *://marathon.jd.com/seckill/seckill.action*
// @match *://marathon.jd.com/koFail.html*
// @match *://cart.jd.com/addToCart.html*
@Ch4s3
Ch4s3 / turboLinksPreFetch.js
Last active February 9, 2022 17:26
decaffeinated version of https://gist.github.com/Enalmada/6e11191c1ea81a75a4f266e147569096 with a flag for turning it on or off
/*
* decaffeinate suggestions:
* DS102: Remove unnecessary code created because of implicit returns
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
const OldHttpRequest = Turbolinks.HttpRequest;
Turbolinks.CachedHttpRequest = class CachedHttpRequest extends Turbolinks.HttpRequest {
constructor(_, location, referrer) {
super();
@asukakenji
asukakenji / 0-go-os-arch.md
Last active June 27, 2025 12:52
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
@dopey
dopey / main.go
Last active April 22, 2025 12:17 — forked from denisbrodbeck/main.go
How to generate secure random strings in golang with crypto/rand.
package main
import (
"crypto/rand"
"encoding/base64"
"fmt"
"io"
"math/big"
)
@F21
F21 / gist:08bfc2e3592bed1e931ec40b8d2ab6f5
Last active October 23, 2022 12:36
Minikube RBAC Quick Start
minikube start --kubernetes-version=v1.7.0 --extra-config=apiserver.Authorization.Mode=RBAC
kubectl create clusterrolebinding add-on-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:default
minikube dashboard
@dfang
dfang / Untitled-6
Last active July 18, 2019 03:07
partner.dhc.jd.com 京东大家电
orderSummary.js
@matthewlehner
matthewlehner / homebrew-postgres-9.6-upgrade.sh
Created November 24, 2016 21:44
Upgrades Homebrew Postgres installation from 9.5 to 9.6
brew services stop postgresql
initdb /usr/local/var/postgres9.6 -E utf8
pg_upgrade -d /usr/local/var/postgres -D /usr/local/var/postgres9.6 -b /usr/local/Cellar/postgresql/9.5.5/bin -B /usr/local/Cellar/postgresql/9.6.1/bin -v
mv /usr/local/var/postgres /usr/local/var/postgres9.5
mv /usr/local/var/postgres9.6 /usr/local/var/postgres
brew services start postgresql
@steinwaywhw
steinwaywhw / One Liner to Download the Latest Release from Github Repo.md
Last active June 22, 2025 18:19
One Liner to Download the Latest Release from Github Repo
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@p4tin
p4tin / handlers_test.go
Created March 22, 2016 17:27
Testing Http Handlers in GO
package main
import (
"net/http"
"testing"
"net/http/httptest"
)
func TestHealthCheckHandler(t *testing.T) {
// Create a request to pass to our handler. We don't have any query parameters for now, so we'll