Skip to content

Instantly share code, notes, and snippets.

View ishenli's full-sized avatar
🎯
Focusing

Michael ishenli

🎯
Focusing
  • Alipay
  • China
View GitHub Profile
@ishenli
ishenli / triangle.js
Created April 4, 2015 03:22
triangle.js
/**
* @file triangle 识别
* @author shenli
* 原理可以参考:http://36kr.com/p/201751.html
*/
var triangle = {
init: function (navContainer, navs) {
var me = this;
@ishenli
ishenli / tips.js
Last active August 29, 2015 14:17
JavaScript Tips
// Verify that a given argument is a number
function isNumber(n){
return !isNaN(parseFloat(n)) && isFinite(n);
}
// Get the max or the min in an array of numbers
var numbers = [5, 458 , 120 , -215 , 228 , 400 , 122205, -85411];
var maxInNumbers = Math.max.apply(Math, numbers);
var minInNumbers = Math.min.apply(Math, numbers);
@ishenli
ishenli / BST.html
Last active August 29, 2015 14:15
BST in JavaScript
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>BST</title>
</head>
<body>
<script>