“The problem happens when a floated element is within a container box, that element does not automatically force the container’s height adjust to the floated element. When an element is floated, its parent no longer contains it because the float is removed from the flow”
http://www.webtoolkit.info/css-clearfix.html
1 .clearfix:after {
2 content: ".";
3 display: block;
4 clear: both;
5 visibility: hidden;
6 line-height: 0;
7 height: 0;
8 }
9
10 .clearfix {
11 display: inline-block;
12 }
13
14 html[xmlns] .clearfix {
15 display: block;
16 }
17
18 * html .clearfix {
19 height: 1%;
20 }
.clearfix:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
.clearfix {
display: inline-block;
}
html[xmlns] .clearfix {
display: block;
}
* html .clearfix {
height: 1%;
}
for example: save all functions in ‘your_theme/stats.php’
1 // comments_count
2 function comments_count() {
3 global $wpdb;
4 $count = "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '1'";
5 echo $wpdb->get_var($count);
6 }
7 // < ?php comments_count() ?> comments
8
9 // posts_count
10 function posts_count() {
11 global $wpdb;
12 $count = "SELECT COUNT(*) FROM $wpdb->posts WHERE post_status = 'publish'";
13 echo $wpdb->get_var($count);
14 }
15 // <?php posts_count() ?></strong> articles
16
17 // retro_count
18 function retro_count() {
19 global $wpdb;
20 $count = "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_type = 'pingback'";
21 echo $wpdb->get_var($count);
22 }
23 // < ?php retro_count() ?> pingbacks
// comments_count
function comments_count() {
global $wpdb;
$count = "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '1'";
echo $wpdb->get_var($count);
}
// < ?php comments_count() ?> comments
// posts_count
function posts_count() {
global $wpdb;
$count = "SELECT COUNT(*) FROM $wpdb->posts WHERE post_status = 'publish'";
echo $wpdb->get_var($count);
}
// <?php posts_count() ?></strong> articles
// retro_count
function retro_count() {
global $wpdb;
$count = "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_type = 'pingback'";
echo $wpdb->get_var($count);
}
// < ?php retro_count() ?> pingbacks
1 svn up -r PREV yourfile
1 htpasswd -bc .htpasswd user pass
htpasswd -bc .htpasswd user pass
1 ffmpeg -itsoffset -4 -i video.mpeg -vframes 1 -an -f mjpeg -s 320x240 video.jpeg
2
3 ffmpeg -i video.flv -vcodec png -ss 00:00:03 -s 320x240 -vframes 1 -an -f rawvideo video.png
ffmpeg -itsoffset -4 -i video.mpeg -vframes 1 -an -f mjpeg -s 320x240 video.jpeg
ffmpeg -i video.flv -vcodec png -ss 00:00:03 -s 320x240 -vframes 1 -an -f rawvideo video.png
1 Event.observe(window, 'load', function() {
2 var fields = $$("input");
3 for (var i = 0; i fields[i].onfocus = function() {this.className += ' focused';}
4 fields[i].onblur = function() {this.className = this.className.replace('focused', '');}
5 }
6 });
7
8
9
10
11
Event.observe(window, 'load', function() {
var fields = $$("input");
for (var i = 0; i fields[i].onfocus = function() {this.className += ' focused';}
fields[i].onblur = function() {this.className = this.className.replace('focused', '');}
}
});
removes all .svn directories recursively
1 find . -name .svn -exec rm -rf {} \;
2
3 find . -name .svn -print0 | xargs -0 rm -rf
find . -name .svn -exec rm -rf {} \;
find . -name .svn -print0 | xargs -0 rm -rf
http://blog.obiefernandez.com/content/2008/06/railsconf-2008.html
1 def javascript_include_all
2 includes = ''
3 Dir.new("#{RAILS_ROOT}/public/javascripts").each do |js|
4 next if js == "." or js == '..' or !js[".js"]
5 includes += javascript_include_tag(js) + "\n"
6 end
7 end
def javascript_include_all
includes = ''
Dir.new("#{RAILS_ROOT}/public/javascripts").each do |js|
next if js == "." or js == '..' or !js[".js"]
includes += javascript_include_tag(js) + "\n"
end
end
1 check this services:
2
3 http://minilink.org/tools.html
4 http://ln-s.net/home/apidoc.jsp
check this services:
http://minilink.org/tools.html
http://ln-s.net/home/apidoc.jsp
1 curl -u email:password -d status="hello world!" http://twitter.com/statuses/update.xml
curl -u email:password -d status="hello world!" http://twitter.com/statuses/update.xml