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
/* | |
* 使用说明: | |
* 本程序以完成固定宽度布局的网页在iPhone/Android设备上浏览时可以适配设备屏幕宽度(竖屏浏览, 暂未支持横屏浏览) | |
* 为目的。正常运行的环境是: iPhone/Android设备的自带浏览器. | |
* 如有问题,意见或建议,请到我的博客页面留言,或发送邮件. | |
* 其他移动版浏览器的适配问题, 不在本程序处理范围, 若有相关问题, 请留言或发送邮件. | |
* | |
* 博客页面地址: | |
* http://www.cnblogs.com/plums/archive/2013/01/10/WebApp-fixed-width-layout-of-multi-terminal-adapter-since.html | |
* 邮箱: limuchen12@126.com |
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
(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
// 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
var url = require('url'); | |
var options = { | |
publicPath: '/test' | |
}; | |
var compiler = { | |
outputPath: '/' | |
}; | |
function pathJoin(a, b) { | |
return a == "/" ? "/" + b : (a||"") + "/" + b; |
NewerOlder