Web font 服务方案: http://www.justfont.com/
Mac下的优化黑体: font-family: helvetica,"Hiragino Sans GB"; 来源:前端观察
AceEditor的等宽文字方案对Mac下也有较好表现 font-family:'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace; 来源:Gist 编辑器
| $(".sparkline").each(function(idx){ | |
| var data = _.map(_.range(60*5),function(i){return 5*i+1000*0.5*Math.sin(i*0.1/Math.PI);}); | |
| var data2 = _.map(data,function(r){return r*(Math.random()+2);}); | |
| var allData = data.concat(data2); | |
| var config = {chartRangeMin:_.min(allData),chartRangeMax:_.max(allData)}; | |
| console.log(config); | |
| $(this).sparkline(data2,_.extend({width:"100%",height:80,lineColor:"hsla(30,100%,60%,0.6)",fillColor:"transparent"},config)); | |
| $(this).sparkline(data,_.extend({width:"100%",height:80,lineColor:"hsla(200,100%,60%,0.6)",fillColor:"hsla(200,100%,60%,0.2)",composite: true},config)); | |
| }); |
Web font 服务方案: http://www.justfont.com/
Mac下的优化黑体: font-family: helvetica,"Hiragino Sans GB"; 来源:前端观察
AceEditor的等宽文字方案对Mac下也有较好表现 font-family:'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace; 来源:Gist 编辑器
| ( ・ิω・ิ)我有一个特异功能, | |
| ( ・ิω・ิ) 我可以把我的眉毛摘下来, | |
| ( ・ิω・)ノิิ摘下, | |
| ( ・ิω・ิ)安上, | |
| ╰ิิ( ・ω・)ノิิ两边都摘下, | |
| ( ・ิω・ิ)安上。。。 | |
| ( ・ω・)。。。安不回来了。 |
| mongoBetweenDate = (date1,date2=false)-> | |
| parseDateStr = (date)-> | |
| dateStr = date.replace(/-/g,"/") | |
| d = new Date dateStr | |
| d = false if d is "Invalid Date" | |
| d | |
| date1 = parseDateStr date1 | |
| where = {} | |
| if date1 |
| getJSON = (url,callback)-> | |
| require("http").get url,(res)-> | |
| res.on "data",(data)-> | |
| data = JSON.parse data.toString() | |
| callback data |
| /* | |
| _.random.str() : "Quick" | |
| _.random.str(3) : "Jumps Jumps Fox" | |
| _.random.list() : [43, 65, 52, 65, 49] | |
| _.random.list(3) : [43, 65, 49] | |
| */ | |
| (function(){ | |
| var methods = { | |
| num:function(num1,num2){ | |
| num1=num1||100; |
| // Example: | |
| JavaScript.load("/javascripts/something.js"); | |
| // With callback (that’s the good thing): | |
| JavaScript.load("http://www.someawesomedomain.com/api.js", function() { | |
| API.use(); // or whatever api.js provides ... | |
| }); |
| // Playground - noun: a place where people can play | |
| import UIKit | |
| class ViewController: UIViewController ,UITableViewDelegate, UITableViewDataSource | |
| { | |
| var tableView: UITableView! | |
| var items: NSMutableArray! | |
| override func viewDidLoad() { | |
| super.viewDidLoad() |
| # usage: app.use "/[collectionName]", require("./routes/[collectionName]") | |
| express = require('express') | |
| class ModelRestfulRouter | |
| findOne:(req,res)-> | |
| @model.findById req.params.id,(err,data)-> | |
| unless err then res.json(data) | |
| find:(req,res)-> | |
| query = req?.query or {} |
| class BaseView | |
| constructor:(options)-> | |
| @options = options | |
| @el = options.el | |
| @$el = $(@el) | |
| @initialize?(options) |