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
| /* | |
| Demo: https://jsfiddle.net/elky/f6khaf2t/ | |
| <div class="element"> | |
| <div class="truncate"> | |
| Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt | |
| ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco | |
| laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in | |
| voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat | |
| non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. |
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
| # one or the other, NOT both | |
| [url "https://github"] | |
| insteadOf = git://github | |
| # or | |
| [url "[email protected]:"] | |
| insteadOf = git://github |
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
| export default { | |
| install(Vue) { | |
| const context = require.context('.', true /* use subdirectory */, /\.vue$/) | |
| context.keys().forEach(key => { | |
| const component = context(key).default | |
| Vue.component(component.name, component) | |
| }) | |
| } | |
| } |
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
| /** | |
| * IE9, IE10 and IE11 requires all of the following polyfills. | |
| */ | |
| import 'core-js/es/symbol'; | |
| import 'core-js/es/object'; | |
| import 'core-js/es/function'; | |
| import 'core-js/es/parse-int'; | |
| import 'core-js/es/parse-float'; | |
| import 'core-js/es/number'; | |
| import 'core-js/es/math'; |
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
| import axios from 'axios'; | |
| import qs from 'qs'; | |
| const sharedConfig = {}; | |
| const formSubmit = axios.create(Object.assign(sharedConfig, { | |
| transformRequest: [function(data, headers) { | |
| headers['Content-Type'] = 'application/x-www-form-urlencoded'; | |
| return qs.stringify(data, { arrayFormat: 'repeat' }); | |
| }], |
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
| npm set registry https://registry.npm.taobao.org # 注册模块镜像 | |
| npm set disturl https://npm.taobao.org/dist # node-gyp 编译依赖的 node 源码镜像 | |
| ## 以下选择添加 | |
| npm set sass_binary_site https://npm.taobao.org/mirrors/node-sass # node-sass 二进制包镜像 | |
| npm set electron_mirror https://npm.taobao.org/mirrors/electron/ # electron 二进制包镜像 | |
| npm set puppeteer_download_host https://npm.taobao.org/mirrors # puppeteer 二进制包镜像 | |
| npm set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver # chromedriver 二进制包镜像 | |
| npm set operadriver_cdnurl https://npm.taobao.org/mirrors/operadriver # operadriver 二进制包镜像 | |
| npm set phantomjs_cdnurl https://npm.taobao.org/mirrors/phantomjs # phantomjs 二进制包镜像 |
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
| var cheerio = require("cheerio"), | |
| fs = require("fs"); | |
| fs.readFile('bookmarks.html', "utf-8", function read(err, data) { | |
| if (err) { | |
| throw err; | |
| } | |
| var $ = cheerio.load(data); | |
| $("a").each(function(index, a) { |
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
| # For ubuntu/trusty64 | |
| # Install basic dependency | |
| apt-get install build-essential | |
| apt-get install libssl-dev | |
| apt-get install libnet-ssleay-perl | |
| apt-get install libcrypt-ssleay-perl | |
| # Install NodeJS | |
| curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash - | |
| apt-get install -y nodejs |
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
| @echo off | |
| for /f "skip=1 delims={}, " %%A in ('wmic nicconfig get ipaddress') do for /f "tokens=1" %%B in ("%%~A") do set "IP=%%~B" | |
| echo Visit: http://%IP%:8000 | |
| http-server -p 8000 |
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 countDown(duration, display) { | |
| var M = 60; | |
| var H = 60 * M; | |
| var D = 24 * H; | |
| var start = Date.now(), | |
| diff, | |
| minutes, | |
| seconds; |
NewerOlder