Skip to content

Instantly share code, notes, and snippets.

View dfang's full-sized avatar
🎯
Focusing

fang duan dfang

🎯
Focusing
View GitHub Profile
@shahidcodes
shahidcodes / Caddyfile
Last active December 5, 2023 05:26
Deploy react spa on caddy, Caddy file
shahid.codes {
try_files {path} /
encode gzip
root * /usr/share/caddy
file_server
}
@dfang
dfang / mirror.md
Last active August 24, 2023 06:50
设置npm yarn的镜像源 或者走代理
npm set registry https://registry.npm.taobao.org && \
npm set disturl https://npm.taobao.org/dist && \
npm set sass_binary_site https://npm.taobao.org/mirrors/node-sass && \
npm set fse_binary_host_mirror https://npm.taobao.org/mirrors/fsevents && \
npm set electron_mirror https://npm.taobao.org/mirrors/electron/ && \
npm set puppeteer_download_host https://storage.googleapis.com.cnpmjs.org && \
npm set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver && \
npm set operadriver_cdnurl https://npm.taobao.org/mirrors/operadriver && \
npm set phantomjs_cdnurl https://npm.taobao.org/mirrors/phantomjs && \
@dhh
dhh / Gemfile
Created June 24, 2020 22:23
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@dfang
dfang / k8s.md
Last active October 15, 2020 16:37
expose services on k8s via nginx-ingress-controller, traefik, ambassador

httpbin, whoami, qotm (quote of the moment) 服务特别适合用来作为测试

kubectl create namespace httpbin
kubectl create deploy httpbin --image=citizenstig/httpbin --port=8000 -n httpbin
kubectl expose deployment httpbin --name=httpbin -n httpbin --port=80 --target-port=8000

kubectl create ns whoami
kubectl create deploy whoami --image=containous/whoami --port=80 -n whoami --replicas=3
kubectl expose deployment whoami --name=whoami -n whoami --port=80 --target-port=80
@tkc49
tkc49 / mocha-chai-puppeteer.js
Last active May 9, 2021 08:35
Mocha と Chai を Puppeteer を使ったテスト
// Puppeteerのインストール
// npm install puppeteer
// Mochaのインストール
// npm install mocha
// chaiのインストール
// npm install chai
const puppeteer = require('puppeteer');
// ==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
@irazasyed
irazasyed / 1-dnsmasq-dnscrypt-proxy-setup.md
Last active May 15, 2024 14:07
How to Setup dnsmasq with dnscrypt-proxy and Cloudflare DNS on macOS

How to Setup dnsmasq with dnscrypt-proxy and Cloudflare DNS on macOS

Using Laravel Valet for localhost development, So it installs dnsmasq with it. dnsmasq runs on port 53, The default DNS port. So we setup dnscrypt-proxy on port 5300 with the default config files in this gist.

dnscrypt-proxy Installation

brew install dnscrypt-proxy
@hetykai
hetykai / setNodeMirror.sh
Last active July 7, 2023 02:44
修改node npm yarn的镜像源设置,替换为国内的淘宝源
npm set registry https://registry.npm.taobao.org && \
npm set disturl https://npm.taobao.org/dist && \
npm set sass_binary_site https://npm.taobao.org/mirrors/node-sass && \
npm set electron_mirror https://npm.taobao.org/mirrors/electron/ && \
npm set puppeteer_download_host https://storage.googleapis.com.cnpmjs.org && \
npm set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver && \
npm set operadriver_cdnurl https://npm.taobao.org/mirrors/operadriver && \
npm set phantomjs_cdnurl https://npm.taobao.org/mirrors/phantomjs && \
npm set selenium_cdnurl https://npm.taobao.org/mirrors/selenium && \
npm set node_inspector_cdnurl https://npm.taobao.org/mirrors/node-inspector && \
@chukaofili
chukaofili / echo-server.yml
Last active October 19, 2021 01:29
Echo Server Deployment
apiVersion: v1
kind: Namespace
metadata:
name: echoserver
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: echoserver
namespace: echoserver