CSS 最小高度

#divid{
    min-height:450px;
    height:auto !important;
}
/*
hard code:
 style="min-height:450px;height:auto !important;"
*/

Other 别名用于提取文件

ex () {
    if [ -f $1 ] ; then
        case $1 in
            *.tar.bz2)   tar xjf $1        ;;
            *.tar.gz)    tar xzf $1     ;;
            *.bz2)       bunzip2 $1       ;;
            *.rar)       rar x $1     ;;
            *.gz)        gunzip $1     ;;
            *.tar)       tar xf $1        ;;
            *.tbz2)      tar xjf $1      ;;
            *.tgz)       tar xzf $1       ;;
            *.zip)       unzip $1     ;;
            *.Z)         uncompress $1  ;;
            *.7z)        7z x $1    ;;
            *)           echo "'$1' cannot be extracted via extract()" ;;
        esac
    else
        echo "'$1' is not a valid file"
    fi
}

Bash Alias用于快速备份

Some might rather have backup put key files somewhere else ie in .backup or /backup 


You could do that pretty easily too... 
Code:

bu () { cp $1 /backup/${1}-`date +%Y%m%d%H%M`.backup ; } 

This would put all files into /backup/ 

Code:

bu () { cp $1 ~/.backup/${1}-`date +%Y%m%d%H%M`.backup ; } 

This would put all the files into ~/.backup (in your home directory) 

this would require that you are IN the directory of the file you want to backup. You would move the file with the bu FILENAME ...... you could not use the /path/filename method like i listed above.

Here's a twist to so you can maintain your backed-up file in the same directory structure in your .backup directory 
Code:

bu () 
{ 
    if [ "`dirname $1`" == "." ]; then 
        mkdir -p ~/.backup/`pwd`; 
        cp $1 ~/.backup/`pwd`/$1-`date +%Y%m%d%H%M`.backup; 
    else 
        mkdir -p ~/.backup/`dirname $1`; 
        cp $1 ~/.backup/$1-`date +%Y%m%d%H%M`.backup; 
    fi 
}

Bash 查找给定应用程序的可能plist-Files

mdfind 'kMDItemFSName == "*textmate*"cw' | grep "\.plist$"

ActionScript 纽扣

descripcion_mc.onRelease = function() {
	gotoAndPlay("descripcion");
};

equipamiento_mc.onRelease = function() {
	gotoAndPlay("equipamiento");
};
precio_mc.onRelease = function() {
	gotoAndPlay("precio");
};
normas_mc.onRelease = function() {
	gotoAndPlay("normas");
};
contactar_mc.onRelease = function() {
	gotoAndPlay("contactar");
};
PDF.onRelease = function() {
	getURL("http://www.mysite.com", "_blank"); 
};

Other 列表分区

cat /etc/fstab

ActionScript 换颜色

ObjColor = new Color(movieclip_mc); 
ObjColor.setRGB(0x989672);

Groovy 在Grails中标记:多对多

def setup = {
    new User(name:'user1').save(flush:true)
    new User(name:'user2').save(flush:true)

    tagsForUser1 = ['tag1','tag2']
    tagsForUser2 = ['tag1']

    u1 = User.findByName('user1')
    u2 = User.findByName('user2')
    
    //ITEM1 ***************************************************
    item1 = new Taggable(name:'item1')
    item1.user = u1
    tagsForUser1.each {
        t = Tag.findByName(it)
        if(!t) {
            t = new Tag(name:it).save()
        }
        item1.addToTags(new Tagging(user:u1,tag:t,taggable:item1))
    }
    item1.save(flush:true)
    
    //ITEM2 **************************************************
    item2 = new Taggable(name:'item2')
    item2.user = u2
    tagsForUser2.each {
        t = Tag.findByName(it)
        if(!t) {
            t = new Tag(name:it).save()
        }
        item2.addToTags(new Tagging(user:u2,tag:t,taggable:item2))
    }
    item2.save(flush:true)
}

//setup()

t = Tag.findByName('tag1')
itemsForUserAndTag = Taggable.withCriteria {
    and {
        eq('user', u2)
        tags {
            eq('tag', t)
        }
    }
}

itemsForTag = Taggable.withCriteria {
    tags {
        eq('tag', t)
    }
}

println "Items for user and tag: $itemsForUserAndTag.name"
println "Items for tag: $itemsForTag.name"

Bash GOTCHA:bash / sh处理未公开的报价

bourne shells silently insert an unbalanced single, double or back quote at EOF (including here-documents)

R mysql更新查询

UPDATE table_name SET column_name1 = value1, column_name2 = value2 WHERE conditions