package_json文件配置说明

npm 与 package.json 快速入门教程 每个项目的根目录下一般都有一个package.json文件,定义项目所需要的各种模块,以及项目的配置信息。npm install则是根据这个配置文件,自动下载所需要的模块,也就是配置项目所需的运行和开发环境。 package.json文件可以手工编写,也可以用npm init命令自动生成,除了项目名称和项目版本是必填的,其他都是选填的。

opkg在小米路由器的使用

{% github openwrt openwrt 759f111 width = 30% %} openwrt.io 小米路由器固件信息

路由器read-only file system怎么改权限

1
mount -o remount,rw /

新建配置

  1. 备份初始conf
1
mv /etc/opkg.conf /etc/opkg.conf.bak
  1. 开始配置 vim /etc/opkg.conf
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
src/gz attitude_adjustment_base http://archive.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/base
src/gz attitude_adjustment_packages http://archive.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/packages/
src/gz attitude_adjustment_luci http://archive.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/luci/
src/gz attitude_adjustment_management http://archive.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/management/
src/gz attitude_adjustment_oldpackages http://archive.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/oldpackages/
src/gz attitude_adjustment_routing http://archive.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/routing/
src/gz openwrt_dist http://openwrt-dist.sourceforge.net/releases/ramips/packages
src/gz openwrt_dist_luci http://openwrt-dist.sourceforge.net/releases/luci/packages
dest root /data
dest ram /tmp
lists_dir ext /data/var/opkg-lists
option overlay_root /data
arch all 100
arch ramips 200
arch ramips_24kec 300
  1. 更新库
1
2
3
$ opkg update
Downloading http://downloads.openwrt.org/..../generic/packages/packages/Packages.gz.
Updated list of available packages in /data/var/opkg-lists/attitude_adjustment.

注:如果下载失败,请确认是否是http而非https。另外如果链接失效可能是更新了包,可以到https://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/base/搜索libc_找到最新下载地址。

brew升级git版本

1
2
3
4
$ brew doctor
$ brew install git 
$ brew link --overwrite git
Linking /usr/local/Cellar/git/2.19.1... 216 symlinks created

为Pod的库创建演示文件SwiftPlayground

{% github asmallteapot cocoapods-playgrounds c54b492 width = 30% %} issues 62

在playground中优雅的使用Pod

This Could Be Us But You Playing

Build Status

Generates a Swift Playground for any Pod.

Installation

$ gem install cocoapods-playgrounds

Usage

CocoaPods

To generate a Playground for a specific Pod:

1
$ pod playgrounds Alamofire

To generate a Playground for a local development Pod:

1
$ pod playgrounds ../../../Sources/Alamofire/Alamofire.podspec

To generate a Playground with multiple Pods:

在playground中执行异步方法

PLAYGROUND 延时运行引入 Playground 的XCPlayground扩展包框架,其中就包括使 Playground 能延时执行的黑魔法,needsIndefiniteExecution(需要无限期执行)使 Playground 具有延时运行的功能. 在实际使用和开发中,我们最经常面临的异步需求可能就是网络请求了,如果我们想要在 Playground 里验证某个 API 是否正确工作的话,使用 XCPlayground 的这个方法开启延时执行也是必要的:

安装Material主题

Hexo + Material + Github 搭建博客与配置

{% github viosey hexo-theme-material d93c5a8 width = 30% %}

注意! 在主题的开发迭代过程中,主题的配置文件模板 可能会改动。为了避免使用 git pull 更新主题的用户出现冲突,我们将 主题配置文件模板 命名为 _config.template.yml。配置主题时,你应该拷贝一份 _config.template.yml 并将其重命名为 _config.yml

hexo作图插件

1
2
"hexo-filter-flowchart": "^1.0.4",
"hexo-filter-sequence": "^1.0.3",
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#作图插件
sequence:
#  webfont: https://cdnjs.cloudflare.com/ajax/libs/webfont/1.6.27/webfontloader.js
#  snap: https://cdnjs.cloudflare.com/ajax/libs/snap.svg/0.4.1/snap.svg-min.js
#  underscore: https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js
#  sequence: https://cdnjs.cloudflare.com/ajax/libs/js-sequence-diagrams/1.0.6/sequence-diagram-min.js
#  css: # optional, the url for css, such as hand drawn theme
options:
theme: simple
css_class:
flowchart:
# raphael:   # optional, the source url of raphael.js
# flowchart: # optional, the source url of flowchart.js
options: # options used for `drawSVG`

博客生成restful风格的json数据源

hexo-generator-restful

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## API接口:以下为默认配置,属性值为 false 表示不生成。
restful:  #http://npm.taobao.org/package/hexo-generator-restful
# site 可配置为数组选择性生成某些属性
# site: ['title', 'subtitle', 'description', 'author', 'since', email', 'favicon', 'avatar']
site: false        # hexo.config mix theme.config
posts_size: 10    # 文章列表分页,0 表示不分页
posts_props:      # 文章列表项的需要生成的属性
title: false
slug: false
date: false
updated: false
comments: false
path: false
excerpt: false
cover: false      # 封面图,取文章第一张图片
content: false
keywords: false
categories: false
tags: false
categories: false  # 分类数据
tags: false        # 标签数据
post: false        # 文章数据
pages: false      # 额外的 Hexo 页面数据, 如 About

git-lfs命令工具使用

{% github git-lfs git-lfs 45c4568 width = 30% %} git-lfs官网 LFS其实是git的一个扩展,并没有改变git的工作方式,有点像耍了个小花招,把指定需要lfs管理的文件替换成了一个指针文件交给git进行版本管理; 在pull/push等这些操作中,lfs又通过lfs服务器把这些文件的真身给下载或上传回来; 通过这样的手段,使得本地仓库的体积大大减小,而不会出现随着这些文件的版本增多而体积剧烈膨胀的情况; 个人觉得这种把存储负担转移给了服务器的做法,是不是有违git去中心化的理念,毕竟lfs这样做其实算是强依赖于这个lfs服务器了,本地仓库并不是一个完整的仓库