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"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Document</title> | |
| </head> | |
| <body> | |
| <div id="btn" >download</div> | |
| <script> |
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
| /** | |
| * 基于tokenizer,做页面处理 | |
| */ | |
| const fs = require('fs') | |
| const html = fs.readFileSync('./index.html', { | |
| encoding: 'utf-8' | |
| }) | |
| const $ = require('cheerio').load(html, { | |
| withDomLvl1: false, | |
| normalizeWhitespace: false, |
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
| const sleep = (fn, d = 500, fail = '') => new Promise((resolve, reject) => { | |
| setTimeout(() => { | |
| if(fail.length) { | |
| reject(fail) | |
| return | |
| } else { | |
| resolve(fn()) | |
| } | |
| }, d) |
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
| server { | |
| listen 8100; | |
| root $HOME/Places/Code/pay-day-loan/dist; | |
| index index.html | |
| server_name 127.0.0.1; | |
| location / { | |
| try_files $uri $uri/ @rewrites; | |
| } | |
| location @rewrites { |
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
| {"lastUpload":"2020-01-30T15:00:17.026Z","extensionVersion":"v3.4.3"} |
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
| h2 Gyro filling | |
| .progress-badge.js-progress-badge.is-filling.is-filling-from-empty | |
| // BADGE | |
| .badge.badge--empty | |
| .badge__fill.js-badge-gyro | |
| .badge__fill-inner |
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
| const PATH = require('path') | |
| function set(obj, path, value) { | |
| let keys = PATH.normalize(path).split('/').filter(Boolean) | |
| let k | |
| while(keys.length) { | |
| k = keys.shift() | |
| if(!obj[k] || typeof obj[k] != 'object') { | |
| obj[k] = keys.length == 0 ? value : {} | |
| } |
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
| #!/bin/bash | |
| from="src" | |
| to="dist" | |
| type="docx" | |
| # 检测brew | |
| if ! command -v brew >/dev/null 2>&1; then | |
| echo "brew没有安装,请安装" | |
| exit 0 | |
| fi |
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
| // -------------------------------------------------- | |
| // Flexbox LESS mixins | |
| // The spec: http://www.w3.org/TR/css3-flexbox | |
| // -------------------------------------------------- | |
| // Flexbox display | |
| // flex or inline-flex | |
| .flex-display(@display: flex) { | |
| display: ~"-webkit-@{display}"; | |
| display: ~"-ms-@{display}box"; // IE10 uses -ms-flexbox |
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 (win) { | |
| var ratio, scaleValue, renderTime, | |
| document = window.document, | |
| docElem = document.documentElement, | |
| vpm = document.querySelector('meta[name="viewport"]'); | |
| if (vpm) { | |
| var tempArray = vpm.getAttribute("content").match(/initial\-scale=(["']?)([\d\.]+)\1?/); | |
| if (tempArray) { | |
| scaleValue = parseFloat(tempArray[2]); | |
| ratio = parseInt(1 / scaleValue); |
NewerOlder