This file contains hidden or 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 toColStr(n) { | |
| str = '' | |
| while (n > 0) { | |
| var mod = (n-1) % 26 | |
| n = Math.floor( (n-1)/26 ) | |
| str = String.fromCharCode( mod + 65 ) + str | |
| } | |
| return str | |
| } |
This file contains hidden or 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 (root, factory) { | |
| root.CrossTab = factory() | |
| }(window, function factory() { | |
| var store = { | |
| get: function (key) { | |
| var strValue = localStorage.getItem(key) | |
| var value | |
| try { | |
| value = JSON.parse(strValue) | |
| } catch (err) { |
This file contains hidden or 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 clone(value) { | |
| var result | |
| if (Array.isArray(value)) { | |
| result = [] | |
| value.forEach(function (item) { | |
| result[result.length] = item | |
| }) | |
| } else if (typeof value === 'object') { | |
| result = {} | |
| Object.keys(value).forEach(function (key) { |
This file contains hidden or 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 flatten(arr, result) { | |
| result = result || [] | |
| arr.forEach(function(item) { | |
| if (Array.isArray(item)) { | |
| flatten(item, result) | |
| } else { | |
| result.push(item) | |
| } | |
| }) |
This file contains hidden or 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 getOrdinal(n) { | |
| var s=["th","st","nd","rd"], | |
| v=n%100; | |
| return n+(s[(v-20)%10]||s[v]||s[0]); | |
| } | |
| function ordinal_suffix_of(i) { | |
| var j = i % 10, | |
| k = i % 100; | |
| if (j == 1 && k != 11) { |
This file contains hidden or 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 lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>GistRun</title> | |
| <!--<link rel="stylesheet" href="styles.css">--> | |
| </head> | |
| <body> | |
| <h1>Hello world!</h1> | |
This file contains hidden or 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 fib(n) { return n < 2 ? n : fib(n-1) + fib(n-2) } | |
| // 使用循环计算 | |
| function fib_1(n) { | |
| var arr = [1, 1] | |
| var curLen | |
| while(arr.length < n) { | |
| curLen = arr.length | |
| arr[curLen] = arr[curLen - 1] + arr[curLen - 2] |
This file contains hidden or 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 vendor(style) { | |
| if (!styles[style]) { | |
| prefixes.map(function (prefix) { | |
| return prefix | |
| ? prefix + style[0].toUpperCase() + style.slice(1) | |
| : style | |
| }).some(function (prefixedStyle) { | |
| if (elementStyle[prefixedStyle] !== void 0) { | |
| styles[style] = prefixedStyle | |
| return true |
This file contains hidden or 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
| C:\Users\Administrator\AppData\Roaming\npm | |
| +-- [email protected] | |
| +-- [email protected] | |
| +-- [email protected] -> C:\Users\Administrator\AppData\Roaming\npm\node_modules\.browser-sync_npminstall\node_modules\.2.18.6@browser-sync | |
| +-- [email protected] | |
| +-- [email protected] | |
| +-- [email protected] | |
| +-- [email protected] | |
| +-- [email protected] | |
| +-- [email protected] -> C:\Users\Administrator\AppData\Roaming\npm\node_modules\.generator-fountain-vue_npminstall\node_modules\.1.0.0-rc2@generator-fountain-vue |
This file contains hidden or 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 getLastDate(y, m) { return new Date(m > 11 ? y + 1 : y, m % 12, 0) } |