Skip to content

Instantly share code, notes, and snippets.

迷渡 justjavac

Block or report user

Report or block justjavac

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@justjavac
justjavac / super-in-babel-typescript.js
Last active May 24, 2017
keyword super in babel and typescript
View super-in-babel-typescript.js
"use strict";
class Point {
getX() {
console.log(this.x); // C
}
}
class ColorPoint extends Point {
constructor() {
View array-destructuring-by-bable.js
"use strict";
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
function fn() {
var _data = data,
_data2 = _slicedToArray(_data, 1),
c = _data2[0];
return c;
View regenerator-by-bable.js
"use strict";
var _asyncGenerator = function () { function AwaitValue(value) { this.value = value; } function AsyncGenerator(gen) { var front, back; function send(key, arg) { return new Promise(function (resolve, reject) { var request = { key: key, arg: arg, resolve: resolve, reject: reject, next: null }; if (back) { back = back.next = request; } else { front = back = request; resume(key, arg); } }); } function resume(key, arg) { try { var result = gen[key](arg); var value = result.value; if (value instanceof AwaitValue) { Promise.resolve(value.value).then(function (arg) { resume("next", arg); }, function (arg) { resume("throw", arg); }); } else { settle(result.done ? "return" : "normal", result.value); } } catch (err) { settle("throw", err); } } function settle(type, value) { switch (type) { case "return": front.resolve({ value: value, done: true }); break; case "throw": front.reject(value); break; default: front.resolve({ value: value, done: false }); break; } front = front.next; if (front) { resume(front.
@justjavac
justjavac / getAddressList_QQ.js
Last active Feb 6, 2017
获取QQ群通讯录
View getAddressList_QQ.js
var ids = document.querySelectorAll(".member_id");
var names = document.querySelectorAll(".member_name");
var output = "", length = ids.length;
for(var i=0; i<length; i++){
output += ids[i].innerHTML.slice(1,-1) + ":" + names[i].innerHTML + "\n";
}
console.log(output);
@justjavac
justjavac / img2txt.js
Last active Oct 22, 2019
img2txt:基于canvas的图片转字符画工具
View img2txt.js
var cv = document.getElementById('cv');
var c = cv.getContext('2d');
var txtDiv = document.getElementById('txt');
var fileBtn = document.getElementById("up-button");
var img = new Image();
img.src = 'a.jpg';
img.onload = init; // 图片加载完开始转换
fileBtn.onchange = getImg;
// 根据灰度生成相应字符
You can’t perform that action at this time.