May 2012
5 posts
1 tag
clearfix
几次面试都被问到清浮动的问题,我就直接把经典的clearfix和bootstrap里看见的.clearfix()的mixin方法报了出来,但其实我写了这么都页面,从来都不知道清浮动到底有什么用,又不好意思说,问了不少人都没给我讲清楚,今天写页面时才终于明白,原来清浮动是用来防止浮动的子元素导致的父元素塌缩的…
一个div.body后有个div.footer,.body里两个div一float,.body高度就成0了,本来遇到这种问题我一向是一个overflow:hidden解决的,但这次里面子div里有个东西需要跃出父div形成样式,这是才发现原来清浮动就可以防止塌缩..
1 tag
user-select →
当然其实只用css就可以实现,如果不兼容老IE。
另外,关于-webkit-user-select和-moz-user-select一个不同点:http://stackoverflow.com/questions/3077950/user-select-none-and-strange-behaviour-in-firefox
Subversion 教程 →
Subversion 官方:http://subversion.apache.org/
1 tag
JS: Hook into existing object methods
NodeJS, Connect, middleware: Log it
function logItHandle(req, res, next) {
var writeHead = res.writeHead; // Store the original function
// Wrap writeHead to hook into the exit path through the layers.
res.writeHead = function (code, headers) {
res.writeHead = writeHead; // Put the original back
// Log the outgoing response
console.log("Response " + counter +...
1 tag
Ubuntu 5
vim
Many of the Vimscript commands you’ll learn can be used in your day-to-day editing as well, but they’re only helpful if they’re in your muscle memory, which simply doesn’t happen from just reading.
看了篇吹NB的教程,看到了个不错的教程,还有KK推荐的learn vimscript the hard way,用apt-get装了vim和vim-gnome,做了下vimtutor
vimrc
...