This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
background: -moz-linear-gradient(center bottom, #b1b1b1 0%, #d3d3d3 99%, white 99%); | |
background: -o-linear-gradient(center bottom, #b1b1b1 0%, #d3d3d3 99%, white 99%); | |
background: -webkit-gradient(linear,left bottom,left top,color-stop(0, #b1b1b1),color-stop(0.99, #d3d3d3),color-stop(0.99, white)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
当前用户的显示器刷新率设置在当前用户目录下.config文件夹下的monitors.xml里。 | |
vi ~/.config/monitors.xml | |
<rate>60</rate> | |
默认是60,修改成85后,保存退出monitors.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
$.fn.clippy = function(text, bgcolor) { | |
if (!bgcolor) { | |
var node = $(this); | |
while (node.css('background-color') == 'transparent' && node.length) { | |
node = node.parent(); | |
} | |
if (!node.length) { | |
bgcolor = '#ffffff'; | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sed -i "s/\.white-box/\.box-d4d4d4/g" `grep '\.white-box' -rl .` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
selector{ | |
property:value; /* all browser */ | |
property:value\9; /* all IE */ | |
padding:8px\0; /* ie8-9 */ | |
*padding:5px; /* ie6-7 */ | |
+property:value; /* IE7 */ | |
_property:value; /* IE6 */ | |
} | |
<!--[if !IE]>NOT IE<![endif]--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rails new NAME -OJ -m https://gist.github.com/raw/903515/rails-template.rb | |
remove_file 'README' | |
remove_file 'public/index.html' | |
remove_file 'public/images/rails.png' | |
prepend_file 'config/boot.rb' do <<-RB | |
begin | |
require 'yaml' | |
YAML::ENGINE.yamler = 'syck' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
request.env['HTTP_REFERER'] | |
request.referer | |
<%= link_to_function "返回上一页", "history.go(-1)" %> | |
<%= link_to "Back", :back %> | |
redirect_to :back |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery.fn.center = function () { | |
this.css('position','absolute'); | |
this.css('top', ( $(window).height() - this.height() ) / +$(window).scrollTop() + 'px'); | |
this.css('left', ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + 'px'); | |
return this; | |
} | |
//这样来使用上面的函数: | |
$(element).center(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~/.rvm/src/ruby-1.8.7-p334/ext/dl | |
rm callback.func | |
touch callback.func | |
ruby mkcallback.rb >> callback.func | |
rm cbtable.func | |
touch cbtable.func | |
ruby mkcbtable.rb >> cbtable.func |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/php | |
<?php | |
kickearlyuser(); | |
function kickearlyuser() { | |
$usernames = array(); | |
$pids = array(); | |
$um = new shell(); | |
$res = $um->ps('sshd:'); | |
foreach ($res as $row) { |
OlderNewer