- 1
- 2
- 3
- 4
- 5
- 1
- 2
A list of Sketch plugins hosted at GitHub, in no particular order.
| var fs = require('fs'), | |
| path = require('path'), | |
| http = require('http'); | |
| var MIME = { | |
| '.css': 'text/css', | |
| '.js': 'application/javascript' | |
| }; | |
| function combineFiles(pathnames, callback) { |
| var iconv = require('iconv-lite'); | |
| function readGBKText(pathname) { | |
| var bin = fs.readFileSync(pathname); | |
| return iconv.decode(bin, 'gbk'); | |
| } |
| 相关资料: | |
| http://wiki.hotoo.me/data-visualization.html | |
| https://zh.wikipedia.org/zh/%E6%95%B0%E6%8D%AE%E5%8F%AF%E8%A7%86%E5%8C%96 | |
| http://blog.jobbole.com/36507/ | |
| http://datavlab.org/ | |
| http://blog.xiqiao.info/tag/data-visualization | |
| http://www.uisdc.com/data-visualization-tools |
| var fs = require('fs'); | |
| var http = require('http'); | |
| http.get('http://img31.mtime.cn/CMS/Gallery/2014/01/01/162652.23483887_160X160.jpg', function(res) { | |
| console.log("Got response: " + res.statusCode); | |
| var fw = fs.createWriteStream('./img2.jpg', {flags: 'w', encoding: 'binary', mode: '0666'}); | |
| res.pipe(fw); | |
| }).on('error', function(e) { | |
| console.log("Got error: " + e.message); | |
| }); |
| var fs = require('fs'); | |
| var http = require('http'); | |
| http.get('http://img31.mtime.cn/CMS/Gallery/2014/01/01/162652.23483887_160X160.jpg', function(res) { | |
| console.log("Got response: " + res.statusCode); | |
| var fw = fs.createWriteStream('./img2.jpg', {flags: 'w', encoding: 'binary', mode: '0666'}); | |
| res.pipe(fw); | |
| }).on('error', function(e) { | |
| console.log("Got error: " + e.message); | |
| }); |
| a = _.reduce($("tr"), function(memo, v, i) { | |
| var $el = $(v); | |
| var obj = {}; | |
| obj.id = $.trim($el.find('.end').text()); | |
| obj.date = $el.find('td').eq(1).text(); | |
| obj.red = $el.find('.STYLE13').html() && $el.find('.STYLE13').html().replace(/ /g, ' '); | |
| obj.blue = $el.find('.STYLE12').text(); | |
| if (obj.id !== '') { | |
| memo.push(obj); | |
| } |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title></title> | |
| <style type="text/css" media="all"> | |
| #a {display: block;width: 200px; margin: 10px;border: 1px solid #f00;} | |
| #span {display:block; width: 100px; margin: 20px; border: 1px solid #0f0;} | |
| </style> | |
| </head> |
| function copy(obj) { | |
| // if (Object.prototype.toString.call(obj) !== '[object Object]') { | |
| if (typeof obj !== 'object') { | |
| return; | |
| } | |
| var ret = obj.constructor === Object ? {} : []; | |
| for (var i in obj) { | |
| if (obj[i].constructor === Array) { | |
| ret[i] = Array.prototype.slice.call(obj[i]); |