This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const shortId = require('shortid'); | |
const {CRC} = require('crc-full'); | |
const MTU = 22; | |
const HEAD_LENGTH = 21; | |
const PAYLOAD_LENGTH = MTU - HEAD_LENGTH; | |
const FLAG = 255; | |
const FLAG_BIT = new Uint8Array([255]); | |
const crc = new CRC('CRC8', 8, 0x07, 0x00, 0x00, false, false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as FS from 'fs'; | |
import { | |
LanguageServiceHost, | |
ScriptSnapshot, | |
createDocumentRegistry, | |
createLanguageService, | |
flattenDiagnosticMessageText, | |
getDefaultLibFilePath, | |
} from 'typescript'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var startTagReg = /^<([^\s!/>]+)[^>]*[^/]?>/; | |
var endTagReg = /^<\/([^>\s]+)>/; | |
var selfCloseTagReg = /^<([^\s>!/]+)[^>]*\/>/; | |
var textContentTagReg = /^[^<]+/; | |
var commentTagReg = /^<!--[\s\S]*?-->/; | |
var selfCloseTagsNameReg = /^img|link|meta|br|hr|base$/i; | |
function parseHTML(html) { | |
var rootChildren = []; | |
var stack = [{ children: rootChildren }]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="image-crop-container"> | |
<div class="crop-area"> | |
<div class="dragable"></div> | |
<div class="mask"></div> | |
<img class="original-img" src="placeholder.gif" /> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let characterSchemaMapping = { | |
'A': [ | |
[0, 0, 0, 1, 0, 0, 0], | |
[0, 0, 1, 0, 1, 0, 0], | |
[0, 1, 0, 0, 0, 1, 0], | |
[1, 0, 0, 0, 0, 0, 1], | |
[1, 1, 1, 1, 1, 1, 1], | |
[1, 0, 0, 0, 0, 0, 1], | |
[1, 0, 0, 0, 0, 0, 1] | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
let MF = window.MF = window.MF || {}; | |
let defaultMessageChannel = null; | |
let pendingWorks = []; | |
let uid = Date.now(); | |
class Message extends MF.Event { | |
constructor(channelId, id) { | |
super(); | |
this._id = id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** 文段集合 */ | |
var ParagraphsHub = (function() { | |
var data = [ | |
'6666666666666666', | |
'第一第一', | |
'哪哪哪哪', | |
'测试', | |
'什么什么什么', | |
'67676767676', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var less = require('gulp-less'); | |
var rename = require('gulp-rename'); | |
var postcss = require('gulp-postcss'); | |
var autoprefixer = require('autoprefixer'); | |
var babel = require('gulp-babel'); | |
var sourcemaps = require('gulp-sourcemaps'); | |
var debug = require('gulp-debug'); | |
var ignore = require('gulp-ignore'); | |
var watch = require('gulp-watch'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { HashMap } from '../types'; | |
export module String { | |
let cachedTemplate = ''; | |
let cachedDefaultValue = ''; | |
let cachedParsedTemplate = ''; | |
function parseTemplate(template: string, defaultValue = '') { | |
if (!template) { | |
return ''; |
NewerOlder