Skip to content

Instantly share code, notes, and snippets.

View njleonzhang's full-sized avatar
💭
I may be slow to respond.

Leon Zhang njleonzhang

💭
I may be slow to respond.
View GitHub Profile
@njleonzhang
njleonzhang / Free_Beyond_Compare.md
Last active February 26, 2024 06:21
Free Beyond Compare by unlimited trail

1 . goto beyond compare folder

 cd "/Applications/Beyond Compare.app/Contents/MacOS/"

2 . rename BCompare to BCompare.real

 mv BCompare BCompare.real
@njleonzhang
njleonzhang / vue2.0 --- cached.md
Last active August 27, 2016 08:44
vue2.0 source code - cached
/**
 * Create a cached version of a pure function.
 */
export function cached (fn: Function): Function {
  const cache = Object.create(null)
  return function cachedFn (str: string): any {
    const hit = cache[str]
    return hit || (cache[str] = fn(str))
 }
@njleonzhang
njleonzhang / append_8_to_version_code.js
Created September 7, 2016 05:41
append extend 8 to android code version.
#!/usr/bin/env node
var path = require('path');
var fs = require('fs');
var xml2js = require('xml2js');
function xmlFileToJs(filename, cb) {
var filepath = path.normalize(path.join(__dirname, filename));
fs.readFile(filepath, 'utf8', function (err, xmlStr) {
if (err) throw (err);
"use strict";
/*use in config.xml <hook type="after_platform_add" src="../path/to/cordova-ios-disable-push.js"/>*/
var fs = require("fs");
var path = require("path");
var COMMENT_KEY = /_comment$/;
function nonComments(obj) {
var newObj = {};
Object.keys(obj).forEach(function(key) {
if (!COMMENT_KEY.test(key)) {
@njleonzhang
njleonzhang / vue2.md
Last active November 2, 2016 09:30
Vue 2.0 reactive principle
class Vue {
  constructor(options) {
    this.$options = options
    this._data = options.data
    // proxy所有的data属性
    Object.keys(options.data).forEach(key => this._proxy(key))
    // 递归的为数据定义get和set
    observer(options.data)
    // 通过调用render进行依赖收集,从而将_render方到相关data属性的watcher队列中 (1)
@njleonzhang
njleonzhang / my vue template change.md
Last active November 16, 2017 03:38
my vue template change
  1. sass
cnpm install sass-loader node-sass --save-dev
  1. pug
cnpm install pug --save-dev
@njleonzhang
njleonzhang / data-tables-hoc.js
Last active November 30, 2017 13:49
try vue hoc
import {DataTables as oDataTables, DataTablesServer as oDataTablesServer} from 'vue-data-tables'
import Vue from 'vue'
let dataTablesHoc = Component => {
return {
components: {
[Component.name]: Component
},
render() {
@njleonzhang
njleonzhang / gist:a905756df2c32f93e70f95c61c036712
Last active April 9, 2018 02:56
testLink 生成每人进度报告。
http://192.168.0.156:3315/testlink/lib/testcases/tcAssignedToUser.php?show_all_users=1&show_inactive_and_closed=1&format=0&tplan_id=2681
result = [];

[].slice.call(document.getElementsByClassName('x-grid-group')).map(user => {
	let nameEl = user.getElementsByClassName('x-grid-group-title')
	let caseEls = user.getElementsByClassName('x-grid3-row')
分级的基本原则是:
P0. 系统主要功能丧失,用户数据受到破坏,造成App崩溃、悬挂等问题。例如程序所引起的死机, 非法退出、死循环、死锁、数据流环节上严重的数值计算错误、产品设计存在严重的安全问题、漏洞被利用后可能导致系统瘫痪、数据丢失或隐私泄露等问题。
P1. 功能部分没有实现、功能与要求不符、数据流错误、程序接口错误、数据流环节上轻微的数值计算错误、性能如内存溢出、响应时间超长等的诸多问题。
P2. 界面出现错误、格式错误、没有进行一些特殊的限制和要求、删除内容没有做提示、存在必填项冗余内容等方面。
P3. 轻微只要发生在一些小的界面方面的问题。例如错别字、提示信息、语法日期显示格式不正确、界面不美观、操作不方便和不习惯等诸多方面。
开发会优先处理优先级为P0和P1的问题。如果对于测试用例的优先级有疑问,可以提出讨论。
@njleonzhang
njleonzhang / release.sh
Created February 28, 2018 02:37
release script for node project
#!/usr/bin/env bash
set -e
if [[ -z $1 ]]; then
echo "Enter new version: "
read VERSION
else
VERSION=$1
fi