Acool

std::cout<<"my mind~!"

唉~

不是不想说,是想说得太多,不知道说啥

o(∩∩)o…哈哈

JQuery插件——HotKeys

今天在做项目时需要做一个页面上的快捷键,就在网上搜了一下,发现了这个插件,JQuery.HotKeys 使用非常的简单,功能也很强大。 这个插件的GitHub地址:https://github.com/jeresig/jquery.hotkeys 示例代码: $("body").bind("keydown", "m", function(el){ $('#markdown_help_tip_modal').modal({ keyboard: true, backdrop: true, show: true }); })

,

JQuery使用小记

在做自己的项目的时候,遇到了一个小小的坎,查阅了很多资料后,终于解决了,闲话少说,上代码。 页面代码大致如下: <h2>123</h2> <p>123</p> <h3>123<h3> <p>123</p> <h2>456</h2> <p>123</p> <h3>123<h3> <p>123</p> <h2>456</h2> <p>123</p> <h3>123<h3> <p>123</p> 因为需要,我想让它变成这个样子: <div> <h2>123</h2> <p>123</p> <h3>123<h3> <p>123</p> </div> <div> <h2>456</h2> <p>123</p> <h3>123<h3> <p>123</p> </div> 但是又不能直接该代码,所以要用JS来实现,在网页加载过程中进行替换和添加。 应用到的JQuery语句是: $("h2").each(function(){ $(this).nextUntil("h2").andSelf().wrapAll("<div></div>"); }); 具体讲解: nextUntil() andSelf() wrapAll

,

让32位ubuntu linux识别3G以上内存

今天发现我的4G内存,ubuntu只识别了2.9G,于是研究了下。 按顺序运行如下命令即解决。 sudo apt-get update sudo apt-get install linux-headers-server linux-image-server linux-server sudo apt-get install linux-generic-pae linux-headers-generic-pae sudo reboot free -m 不过新版的debian sid好像已经是pae内核了,就可以识别了。

,

唉~

谁能告诉我,我哪里做错了~?

昨晚又梦到她了,唉

gem install mysql 错误解决

ubuntu下安装mysql是可能会遇到下面的错误 sudo gem install mysql Building native extensions. This could take a while… ERROR: Error installing mysql: ERROR: Failed to build gem native extension. /usr/bin/ruby1.8 extconf.rb checking for mysql_query() in -lmysqlclient… no checking for main() in -lm… yes checking for mysql_query() in -lmysqlclient… no checking for main() in -lz… yes checking for mysql_query() in -lmysqlclient… [...]

, , ,

nginx+wordpress URL静态化实现

今天把blog的URL做了静态化,用到了插件wp-super-cache。这个是比较优秀的缓存插件,配置什么的都很简单。 首先,设置wordpress的固态链接形式,打开wordpress的这个功能。 进入后台,点击设置->固定链接,然后选择自定义,输入你要定义的URL形式。 样式:http://www.yourwebsite.com/category/post-name.html 写法: /%category%/%postname%.html 其他规则还有: 样式:http://www.yourwebsite.com/123.html 写法:/%post_id%.html 样式:http://www.yourwebsite.com/archives/123.html 写法:/archives/%post_id%.html 样式:http://www.yourwebsite.com/2007/09/16/post-name.html 写法:/%year%/%monthnum%/%day%/%postname%.html 样式:http://www.yourwebsite.com/2007/03/post-name.html 写法:/%year%/%monthnum%/%postname%.html 样式:http://www.yourwebsite.com/archives/post-name.html 写法:/archive/%postname%.html 样式:http://www.yourwebsite.com/post-name.html 写法:/%postname%.html 说明: %year% 文章发布的年份,4位数字,如:2004 %monthnum% 文章发布的月份,2位数字,如:05 %day% 文章发布当月的第几天,2位数字,如:28 %hour% 文章发布时间中的“小时”,2位数字,如:15 %minute% 文章发布时间中的“分钟”,2位数字,如:43 %second% 文章发布时间中的“秒”,2位数字,如:33 %postname% 文章的标题。如,文章标题为“This Is A Great Post!”,那么%postname%表示为“this-is-a-great-post” %post_id% 文章的唯一编号 %category% 文章所在的分类 %author% 文章的作者 然后安装插件,开启插件。这个时候,网站还不能访问,需要配置Nginx。 编辑你的wordpress对应的Nginx配置文件,Server中加入如下内容。 location / { index index.html index.php; if (-d $request_filename){ [...]

, ,

推荐个网站:Rails Best Practices

http://rails-bestpractices.com/ 很好的学习rails的网站。

Previous Posts