IIssNan's Notes

Quick notes


  • 首页

  • 归档

  • 标签

  • 搜索

ReactJS: Keep Simple. Everything can be a component!

发表于 2014-12-31 | | 阅读次数

Talk about ReactJS and how to turn your development process to much easier and simple.

By Pedro Nauck

Using custom fonts in Rails 4

发表于 2014-12-30 | | 阅读次数

在 Rails 4 应用中使用自定义字体,只需以下步骤:

  1. 在 app/assets 目录下添加fonts目录
  2. 将自定义字体放置于 app/assets/fonts 目录下
  3. 在定义字体的 CSS 文件中,使用 font-url 函数来调用字体。例如:
1
2
3
4
5
6
@font-face {
font-family: 'Lato',
src: font-url('lato.woff') format('woff');
font-weight: normal;
font-style: normal;
}

另外,当使用多种自定义字体的时候,可以将字体文件放进各自的子目录中。引用的时候,只要在对应的字体定义中包含子目录名称即可。例如:

1
2
3
@font-face{
src: font-url('lato/lato.woff') format('woff');
}

今日阅读

发表于 2014-12-29 | 分类于 Reading List | | 阅读次数
  • How to prevent page scrolling when scrolling a DIV element?
  • Element.scrollIntoView()
  • getBoundingClientRect is Awesome

今日阅读

发表于 2014-12-28 | 分类于 Reading List | | 阅读次数

RailsGuide - Rails 入门
RailsGuide - Action Controller 简介
RailsGuide - Rails 路由全解
RailsGuide - Rails 布局和视图渲染
RailsGuide - Active Record 基础
RailsGuide - Active Record 关联

Debug grunt tasks with node-inspector

发表于 2014-12-24 | | 阅读次数

随着项目的增长,Grunt任务也相对地变复杂。通过console.log或者grunt.log.writeln等方法去调试会变得越来越耗时。所幸的是,可以使用Node Inspector来做断点调试,以增加Grunt任务的开发效率。

Node Inspector是一个基于Blink Developer Tools的图形化调试工具,可以用来调试NodeJs应用。安装Node Inspector:

1
npm install -g node-inspector

完成之后即可以开始调试,步骤如下:

  • 在任务代码中添加断点代码debugger
  • 启动Node Inspector

    node-debug --web-port=9999 grunt-path task-name --task-option
    

    在Windows 7系统中, 如果通过全局安装grunt-cli的话,那么grunt-path 就是 %appdata%\npm\node_modules\grunt-cli\bin\grunt。

参考:

  • Node Inspector
  • Using node-inspector with grunt tasks
1…567…37
IIssNan

IIssNan

胡编一通,乱写一气

183 日志
6 分类
111 标签
RSS
GitHub Twitter 豆瓣 知乎
© 2011 - 2017 IIssNan
由 Hexo 强力驱动
主题 - NexT.Pisces
0%