HTML:
<div class="box">
<div class="sidebar">
侧边栏
</div>
<div class="main">
主要内容
user www-data; | |
http { | |
## | |
# Basic Settings | |
## | |
sendfile on; | |
tcp_nopush on; |
#!/usr/bin/env node | |
console.log('npx is cool!') |
{ | |
"editor.wordSeparators": "`~!@#$%^&*()=+[{]}\\|;:'\",.<>/?", | |
"editor.tabSize": 2, | |
"editor.detectIndentation": false, | |
"files.associations": { | |
"*.wxml": "html", | |
"*.wxss": "css", | |
"*.html": "html" | |
}, | |
"window.zoomLevel": 1, |
// By @coderitual | |
// https://twitter.com/coderitual/status/1112297299307384833 | |
// Remove any duplicates from an array of primitives. | |
const unique = [...new Set(arr)] | |
// Sleep in async functions. Use: await sleep(2000). | |
const sleep = (ms) => (new Promise(resolve => setTimeout(resolve, ms))); | |
// Type this in your code to break chrome debugger in that line. |
HTML:
<div class="box">
<div class="sidebar">
侧边栏
</div>
<div class="main">
主要内容
function cached(callback){ | |
let cached = {} | |
return function(id){ | |
const hit = cached[id] | |
return hit || (cached[id] = callback[id]) | |
} | |
} | |
//使用 | |
const idToTemplate = cached(id => { |
/* | |
* Taken from http://stackoverflow.com/questions/5867534/how-to-save-canvas-data-to-file/5971674#5971674 | |
*/ | |
var fs = require('fs'); | |
// string generated by canvas.toDataURL() | |
var img = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0" | |
+ "NAAAAKElEQVQ4jWNgYGD4Twzu6FhFFGYYNXDUwGFpIAk2E4dHDRw1cDgaCAASFOffhEIO" | |
+ "3gAAAABJRU5ErkJggg=="; | |
// strip off the data: url prefix to get just the base64-encoded bytes |
Eric Steven Raymond, Thyrsus Enterprises, < esr@thyrsus.com >
Rick Moen, < respond-auto@linuxmafia.com >
翻译:柯非, < zer4tul@gmail.com >
这篇译文基于2014.05.21更新的原文修订版3.10。
特别感谢王刚,此前本文的翻译是由他进行的。