Skip to content

Commit 41dab55

Browse files
committed
first commit
0 parents  commit 41dab55

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+8127
-0
lines changed

.gitignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
node_modules/
3+
cache/
4+
static-tmp/
5+
tmp/
6+
7+
npm-debug.log
8+
nohup.out
9+
10+
.vscode/
11+
.DS_Store
12+
13+
composer.phpar
14+
15+
package-lock.json

.gitmodules

Whitespace-only changes.

.travis.yml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
branches:
2+
only:
3+
- master
4+
os:
5+
- linux
6+
7+
language: node_js
8+
9+
dist: trusty
10+
11+
sudo: required
12+
13+
node_js:
14+
- "node"
15+
16+
before_install:
17+
- sudo add-apt-repository -y ppa:dhor/myway
18+
- sudo apt-get -qq update
19+
- sudo apt-get -y install graphicsmagick
20+
- sudo apt-get -y install imagemagick
21+
22+
install:
23+
- npm install
24+
25+
env:
26+
global:
27+
- GH_REF: github.com/wilon/wilon.github.io.git
28+
29+
script:
30+
# git settings
31+
- git config --global user.name "Travis CI"
32+
- git config --global user.email "travis@travis-ci.org"
33+
- git remote set-url origin https://${GH_TOKEN}@${GH_REF}
34+
- git checkout master
35+
# update
36+
- npm start
37+
- git show | grep 'Author.*<travis@' || gulp sitemap
38+
39+
after_script:
40+
# commit
41+
- ls -l cache/index.html index.html
42+
- cat cache/*.json
43+
- git add .
44+
- git commit -m "Travis CI Auto Commit" &
45+
- git push --force origin master
46+
47+
cache:
48+
directories:
49+
- node_modules
50+
51+
notifications:
52+
email:
53+
recipients:
54+
- wilonx@163.com
55+
on_success: never
56+
on_failure: never

README.md

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
2+
# wilon.github.io
3+
[![Build Status](https://travis-ci.org/wilon/wilon.github.io.svg?branch=master)](https://travis-ci.org/wilon/wilon.github.io)
4+
5+
A simple notes show page. Fast search and copy.
6+
7+
![show-gif](https://user-images.githubusercontent.com/7512755/27375951-40603768-56a3-11e7-9b1e-a7b66927dc98.gif)
8+
9+
10+
## Require
11+
12+
Require Latest `nodejs` + `npm` + `gulp`, And Ubuntu require:
13+
14+
```shell
15+
sudo add-apt-repository ppa:dhor/myway
16+
sudo apt-get update
17+
sudo apt-get install graphicsmagick
18+
sudo apt-get install imagemagick
19+
```
20+
21+
## Development
22+
23+
```shell
24+
git clone https://github.com/wilon/wilon.github.io.git
25+
cd wilon.github.io
26+
npm install
27+
gulp server
28+
```
29+
30+
Then open [http://localhost:3000](http://localhost:3000) in your browser.
31+
32+
## Build your own github.io webpage notes
33+
34+
* Fork this repo.
35+
* Modify `.travis.yml :27 & :54` to your settings. And add your travis Environment Variables `GH_TOKEN`.
36+
* Next add your own notes.↓↓↓
37+
38+
## Add Notes
39+
40+
1. Write notes
41+
42+
`data/{SOME_NOTE}.md`
43+
44+
2. Add icon
45+
46+
`src/images/{SOME_NOTE}.png`
47+
48+
3. Browser Sync
49+
50+
## Tips
51+
52+
You must write notes file `data/{SOME_NOTE}.md` like this:
53+
54+
### ${note title}
55+
```${note code language}
56+
${note content}
57+
...
58+
```

data/discuz.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
3+
### 文件、方法位置
4+
```php
5+
source\module\portal\portal_view.php // 文章详情页方法
6+
template\xxx\portal\view_xx.htm // 文章详情页模板,根据设置有所不同
7+
```
8+
9+
### 首页设置portal隐藏
10+
```php
11+
// 1. 全局-域名设置-应用域名:
12+
// 默认:www.xxx.com
13+
// 2. 界面-导航设置-主导航:
14+
// 去掉内置首页,添加一个首页[链接为/]
15+
```
16+
17+
### 只加载DB
18+
```php
19+
define('IN_DISCUZ', true);
20+
require_once './source/function/function_core.php';
21+
require_once './source/class/discuz/discuz_database.php';
22+
require_once './config/config_global.php';
23+
class DB extends discuz_database {}
24+
$driver = function_exists('mysql_connect') ? 'db_driver_mysql' : 'db_driver_mysqli';
25+
require_once \"./source/class/db/$driver.php\";
26+
DB::init($driver, $_config['db']);
27+
```
28+

data/git.md

+166
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
2+
### 修改一些信息
3+
```bash
4+
git commit --amend # 修改commit
5+
git reset . # commit前取消add缓冲
6+
```
7+
8+
### 子模块 submodule
9+
```shell
10+
git submodule add 仓库地址 路径 # 添加子模块
11+
git submodule update --init --recursive # 更新子模块
12+
git rm ./xxx & rm -rf ./xxx # 删除子模块
13+
```
14+
15+
### 初始新仓库流程
16+
```bash
17+
# 1. 新建项目
18+
git clone https://github.com/wilon/wilon.github.io.git # 代码copy进来,直接push
19+
# 2. 已有项目
20+
git init
21+
git remote add origin https://github.com/wilon/wilon.github.io.git
22+
git pull
23+
git merge origin/master
24+
git push --set-upstream origin master
25+
#-- 或修改 .git/config
26+
[remote "origin"]
27+
url = https://github.com/wilon/oh-my-zsh.git
28+
fetch = +refs/heads/master:refs/remotes/origin/master
29+
[branch "master"]
30+
remote = origin
31+
merge = refs/heads/master
32+
```
33+
34+
### 分支
35+
```shell
36+
# 本地分支操作
37+
git branch # 查看本地分支
38+
git branch -r # 查看远程分支
39+
git branch -a # 查看所有分支
40+
git branch [name] # 创建本地分支
41+
git branch -d [name] # 删除分支
42+
git checkout [name] # 切换分支
43+
git checkout -b [name] # 创建新分支并立即切换到新分支
44+
git merge [name] # 合并name分支到当前分支
45+
# 远程分支操作
46+
git push origin [name] # 创建远程分支(本地分支push到远程)
47+
git push origin :heads/[name] # 删除远程分支
48+
git push origin test:master # 提交本地test分支作为远程的master分支,远程的github就会自动创建一个test分支
49+
git push origin test:test # 提交本地test分支作为远程的test分支
50+
git push origin :test # 删除远程分支,刚提交到远程的test将被删除,但是本地还会保存的,不用担心
51+
# 修改默认HEAD指向分支
52+
vim .git/refs/remotes/origin/HEAD
53+
`ref: refs/remotes/origin/master`
54+
```
55+
### 远程仓库
56+
```shell
57+
git clone git://github.com/jquery/jquery.git # 检出仓库
58+
git remote -v # 查看远程仓库
59+
git remote add [name] [url] # 添加远程仓库
60+
git remote rm [name] # 删除远程仓库
61+
git remote set-url --push[name][newUrl] # 修改远程仓库
62+
git pull [remoteName] [localBranchName] # 拉取远程仓库
63+
git push [remoteName] [localBranchName] # 推送远程仓库
64+
```
65+
66+
### 私钥与公钥
67+
```shell
68+
# TortoiseGit 使用 id_rsa
69+
# 1. 生成Putty key:puttygen工具,Conversions -> Import key -> Save private key;
70+
# 2. clone时使用
71+
ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa -q -b 2048 # 生成公私钥
72+
ssh-keygen -l -f ~/.ssh/id_rsa.pub # 查看公钥指纹
73+
```
74+
75+
### 新模块工作流程
76+
```shell
77+
# 主分支master下
78+
git add mynewsfile/* # 添加文件
79+
git commit [-a] -m '说明' # 提交到本地库,-a所有改动
80+
git pull # 从远程库拉取
81+
git push [origin master] # 提交到远程库,默认master
82+
```
83+
84+
### 小改动工作流程
85+
```shell
86+
# 主分支master下
87+
git add file/* # 添加文件
88+
git commit [-a] -m '说明' # 提交到本地库,-a所有改动
89+
git pull # 从远程库拉取
90+
# 解决冲突
91+
git push [origin master] # 提交到远程库,默认master
92+
```
93+
94+
### tag 管理
95+
```shell
96+
git tag # 列出所有 tag
97+
git tag v1.0.1 # 创建 tag: v1.0.1
98+
git push origin --tags # 将 tag 推送到远库
99+
git tag -d v1.0.1 # 删除本地 tag
100+
git push origin :refs/tags/v1.0.1 # 删除远程仓库 tag
101+
```
102+
103+
### 查看一些东西
104+
```shell
105+
vim .git/config # 查看项目皮配置
106+
git status # 项目目录里
107+
git branch -a # 查看所有分支,*代表本地
108+
git diff 文件 # 当期文件修改
109+
git log # 查看提交日志
110+
git log -p # 查看提交日志,包含代码
111+
git log --graph # 以图表形式查看分支提交日志
112+
git show # 查看最近一次提交代码
113+
git show commit_id # 查看某一次提交代码
114+
```
115+
116+
### 配置一些东西
117+
```shell
118+
# 1. 命令配置
119+
git config --global color.diff auto && git config --global color.status auto && git config --global color.branch auto # git配置颜色
120+
git config --global alias.st status # git配置别名
121+
git config --global user.name wilon && git config --global user.email wilonx@163.com # git配置用户名邮箱
122+
git config --global http.proxy "127.0.0.1:8087" # 设置代理
123+
# 2. 修改配置文件 ~/.gitconfig,已同步在oh-my-zsh项目里
124+
wget <a href="https://raw.githubusercontent.com/wilon/oh-my-zsh/master/templates/gitconfig.zsh-template" target="_blank">https://raw.githubusercontent.com/wilon/oh-my-zsh/master/templates/gitconfig.zsh-template</a> -O ~/.gitconfig
125+
```
126+
127+
### 其他
128+
```shell
129+
git clone https://github.com/Wilon/mynote.git # 克隆一个项目
130+
git reset --hard HEAD~1 # 回退所有内容到上N个版本,数字可变
131+
```
132+
133+
### install 安装最新版
134+
```shell
135+
# 1. 下载 tar 包,https://github.com/git/git/releases
136+
# 2. 解压
137+
wget https://github.com/git/git/archive/v2.15.0.tar.gz
138+
tar -zxvf v2.15.0.tar.gz
139+
cd git-2.15.0/
140+
make prefix=/usr/local/git all
141+
make prefix=/usr/local/git install
142+
echo 'export PATH=$PATH:/usr/local/git/bin' >> /etc/bashrc
143+
source /etc/bashrc
144+
```
145+
146+
147+
### git rebase, 合并commit
148+
```shell
149+
# 1, 查看log
150+
git log
151+
# 2, 找到合并到哪里的 commit hash, 执行合并
152+
git rebase -i [hash]
153+
# 3, 编辑合并选项,参考操作下面的文档说明
154+
# 4, 提交
155+
git push --force
156+
# 其他
157+
git rebase --abort # 撤销 rebase
158+
```
159+
160+
### Git pull 强制覆盖本地文件
161+
```shell
162+
git fetch --all
163+
git reset --hard origin/master
164+
git pull
165+
# 或者 git reset --hard HEAD~[N] , 再 pull
166+
```

data/go.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
### go get使用代理
3+
```bash
4+
export http_proxy=http://127.0.0.1:51967
5+
export https_proxy=http://127.0.0.1:51967
6+
go get ...
7+
```

data/jquery.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
### jquery dom 与 string 之间转换
3+
```js
4+
var string = '<div class="div1">Hello World!</div><div class="div2">Hello World!2333</div>'
5+
// string 转成对象处理
6+
var divEle = $('<div/>');
7+
divEle.html(string);
8+
divEle.find('.div2').html('<h1>Hello World!2333</h2>');
9+
console.log(divEle.html());
10+
```

0 commit comments

Comments
 (0)