Skip to content

Instantly share code, notes, and snippets.

View lxneng's full-sized avatar
🎯
Focusing

Eric Luo lxneng

🎯
Focusing
View GitHub Profile
@lxneng
lxneng / gist:1000424
Created May 31, 2011 12:27
div>img居中显示

div>img居中显示

html:

   <div class="bodyShape">
       <img src="${tools.static_url('media/images/SHAPE_'+user.body_shape+'_96_transparent.png')}"
alt="${user.body_shape}" />
   </div>
[global]
workgroup = WORKGROUP
server string = %h server (Samba, Ubuntu)
dns proxy = no
log file = /var/log/samba/log.%m
max log size = 1000
unix charset = utf8
@lxneng
lxneng / gist:999841
Created May 31, 2011 04:08
"brew-pip" lets you install Python applications to the Cellar:

"brew-pip" lets you install Python applications to the Cellar:

$ sudo brew install https://github.com/josh/brew-pip/raw/master/Formula/brew-pip.rb
Password:
######################################################################## 100.0%
==> Downloading https://github.com/josh/brew-pip/tarball/v0.1.1
######################################################################## 100.0%
@lxneng
lxneng / gist:994604
Created May 27, 2011 03:44
How do you get git to always pull from a specific branch?

Under [branch "master"], try adding the following to the repo's Git config file (.git/config):

[branch "master"]
    remote = origin
    merge = refs/heads/master

This tells Git 2 things:

When you're on the master branch, the default remote is origin. When using git pull on the master branch, with no remote and branch specified, use the default remote (origin) and merge in the changes from the master branch.

div>img 底部对齐

html code

<div class="bodyShape">
    <div class="barbara">
ul#NM_ComNavigationMain ul.categoryList {
background-color: #FFFFFF;
box-shadow: 1px 1px 10px 2px #999999;
display: none;
left: 1px;
padding: 0 0 8px;
position: absolute;
top: 36px;
visibility: hidden;
z-index: 900;
> jQuery.fn.jquery
"1.4.2"
from xmlbuilder import XMLBuilder
def _generate_xml(self, exception):
_,_,trace = sys.exc_info()
xml = XMLBuilder()
with xml.notice(version = 2.0):
xml << ('api-key', self.environment.api_key)
with xml.notifier:
xml << ('name', self.environment.name)
xml << ('version', self.environment.version)
1:判断radio
var selected = $('input[name=selectid:checked]').val();//若未被选中 则val() = null
if(selected == null){
alert("未选中!");
}else{
alert("选中!");
}
grep -c '' filename
cat filename | wc -l