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 / mirrors
Last active March 11, 2022 15:48
Mirrors in China
# mirrors in China
## rubygems mirror(ruby.taobao.org)
use ruby.taobao.org as mirror on local machine(https://ruby-china.org/topics/15534)
`bundle config mirror.https://rubygems.org http://ruby.taobao.org`
`less ~/.bundle/config`
## npm mirror(npm.taobao.org)
https://cnodejs.org/topic/4f9904f9407edba21468f31e
http://riny.net/2014/cnpm/
@dfang
dfang / gist:c463f3420a801480b1c8041372889a1f
Last active April 28, 2016 04:27
install python 2.7.9 on ubuntu 14.04
for odoo, python 2.7.9 is best
https://www.odoo.com/documentation/8.0/setup/install.html#setup-install-source
https://www.v2ex.com/t/260379
https://profcollab.wordpress.com/2015/06/02/%D0%BF%D1%80%D0%B8%D0%B2%D0%B5%D1%82-%D0%BC%D0%B8%D1%80/
https://renoirboulanger.com/blog/2015/04/upgrade-python-2-7-9-ubuntu-14-04-lts-making-deb-package/
https://github.com/yyuu/pyenv
https://www.python.org/ftp/python/2.7.9/
@dfang
dfang / ENV and ARG
Last active May 8, 2016 16:41
Dockfile
```Dockerfile
FROM busybox
ARG EXPOSED_PORTS
ENV EXPOSED_PORTS ${EXPOSED_PORTS:-20000}
RUN echo ${EXPOSED_PORTS}
EXPOSE ${EXPOSED_PORTS}
```
这种写法也可以不传 --build-arg
docker build -t test .
this is settings backed up by atom sync-settings package
@dfang
dfang / app_index.html
Last active January 7, 2017 06:06
webpack-dev-server weird bug, --hot and --inline option order matters ?
<html>
<head>
<title>Webpack HMR demo</title>
</head>
<body>
<script src="bundle.js"></script>
</body>
</html>
@dfang
dfang / homebrew-postgres-9.6-upgrade.sh
Created March 14, 2017 03:47 — forked from matthewlehner/homebrew-postgres-9.6-upgrade.sh
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
@dfang
dfang / postgres-upgrade-recipe.sh
Created March 14, 2017 05:00 — forked from chrismccord/postgres-upgrade-recipe.sh
Upgrade Postgres to 9.4 using Homebrew on Mac OSX
#!/bin/bash
# This script can be used in "run & hope" mode or you can use it as a recipe to
# do things manually - you probably want the latter if you really care about
# the data in your databases.
# Happy hacking
# /Eoin/
# Tell bash to stop if something goes wrong
set -e
@dfang
dfang / Untitled-6
Last active July 18, 2019 03:07
partner.dhc.jd.com 京东大家电
orderSummary.js
@dfang
dfang / gist:ca8a6c96c9bc4a4e8ee1e930267d1a3a
Created August 11, 2017 08:32
compile nginx with pagespeed dynamic module support
NPS_VERSION=1.12.34.2-stable
NPS_RELEASE_NUMBER=${NPS_VERSION/stable/}
sudo apt-get update \
&& sudo apt-get install -y unzip \
&& sudo apt-get build-dep nginx=1.13.3 \
&& cd \
&& apt-get source nginx=1.13.3 \
&& cd \
&& wget https://github.com/pagespeed/ngx_pagespeed/archive/v${NPS_VERSION}.zip \
PATH=$PATH:`yarn global bin`
alias gs='git status'
alias ga='git add'
alias gd='git diff'
alias gdc='git diff --cached'
alias gb='git branch'
alias gba='git branch --all'
alias g='git'
alias y='yarn'