Skip to content

Instantly share code, notes, and snippets.

View ximing's full-sized avatar
🤓
I may be slow to respond.

席铭 ximing

🤓
I may be slow to respond.
View GitHub Profile
~~count === count || 0
@ximing
ximing / diff.js
Created August 4, 2017 06:12
quill diff
function findDiff() {
var oldContent = quill_old.getContents();
var newContent = quill_new.getContents();
var diff = oldContent.diff(newContent);
// console.log('old', oldContent);
// console.log('new', newContent);
for (var i = 0; i < diff.ops.length; i++) {
var op = diff.ops[i];
// if the change was an insertion
if (op.hasOwnProperty('insert')) {
@ximing
ximing / function_invocation.js
Created April 9, 2017 11:54 — forked from myshov/function_invocation.js
11 Ways to Invoke a Function
console.log(1);
(_ => console.log(2))();
eval('console.log(3);');
console.log.call(null, 4);
console.log.apply(null, [5]);
new Function('console.log(6)')();
Reflect.apply(console.log, null, [7])
Reflect.construct(function(){console.log(8)}, []);
Function.prototype.apply.call(console.log, null, [9]);
Function.prototype.call.call(console.log, null, 10);
@ximing
ximing / RxJS 5 Operators By Example.md
Created January 5, 2017 13:37 — forked from lyyourc/RxJS 5 Operators By Example.md
「译」RxJS 5 Operators By Example
@ximing
ximing / rxjs_operators_by_example.md
Created January 4, 2017 18:24 — forked from btroncone/rxjs_operators_by_example.md
RxJS 5 Operators By Example