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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title>Untitled benchmark</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script> | |
<script src="./suite.js"></script> | |
</head> | |
<body> | |
<h1>Open the console to view the results</h1> |
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
export default class EventBus { | |
constructor () { | |
this.bus = document.createElement('span') | |
} | |
on (eventName, fn) { | |
const handler = event => { | |
fn && fn(...event.params) | |
} | |
this.bus.addEventListener(eventName, handler) |
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
{ | |
"ret": 0, | |
"items": [ | |
{ | |
"market": "US", | |
"sectors": [ | |
{ | |
"name": "工业产品", | |
"industries": [ | |
{ |
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
[tooltip], | |
[tooltip-top], | |
[tooltip-right], | |
[tooltip-left], | |
[tooltip-bottom] { | |
@bgcolor: #495364; | |
position: relative; | |
cursor: pointer; | |
&:before, | |
&:after { |
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
#!/bin/bash | |
# Merge Github branch | |
# | |
# Usage: | |
# shells/merge-branch.sh <base-branch> <head-branch> [commit message] | |
request=$( cd "$(dirname "${BASH_SOURCE}")" ; pwd -P )/request.sh | |
# The name of the base branch that the head will be merged into. |
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
#!/bin/bash | |
# Request Github Api | |
# | |
# Usage: | |
# shells/request.sh <GET|POST> <api> [params] | |
# | |
# Sample: | |
# ./shells/request.sh POST merges \ | |
# "{\"base\":\"master\",\"head\":\"develop\",\"commit_message\":\"$message\"}" |
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
// Brainfuck. | |
// | |
// codewars: https://www.codewars.com/kata/my-smallest-code-interpreter-aka-brainf-star-star-k/train/javascript | |
// brainfuck debug tool: http://www.iamcal.com/misc/bf_debug/ | |
// brainfuck on wikipedia: https://zh.wikipedia.org/wiki/Brainfuck | |
function brainLuck(code, input){ | |
let codeInArray = code.split(''); | |
let inputInArray = input.split(''); | |
console.log(code); |
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 (doc, win) { | |
var docEl = doc.documentElement, | |
resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize', | |
recalc = function () { | |
var clientWidth = docEl.clientWidth; | |
if (!clientWidth) return; | |
docEl.style.fontSize = 36 * (clientWidth / 320) + 'px'; | |
}; | |
if (!doc.addEventListener) return; | |
win.addEventListener(resizeEvt, recalc, 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
var url = require('url'); | |
var options = { | |
publicPath: '/test' | |
}; | |
var compiler = { | |
outputPath: '/' | |
}; | |
function pathJoin(a, b) { | |
return a == "/" ? "/" + b : (a||"") + "/" + b; |
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 isMobile = false; | |
$editor.on('click', '.comment-bar', function(event) { | |
if(isMobile) return null; | |
handleBarClick(event); | |
}); | |
$editor.on('touchstart', '.comment-bar', function(event) { | |
isMobile = true; | |
handleBarClick(event); |
NewerOlder