自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(628)
  • 资源 (7)
  • 问答 (1)
  • 收藏
  • 关注

原创 brew service restart

[code="java"]brew services restart memcached[/code]

2013-07-06 22:56:44 447

原创 git如何合并 多个commit

需要先搞明白rebase然后,进这个界面[code="java"]pick b76d157 bpick a931ac7 c# Rebase df23917..a931ac7 onto df23917## Commands:# p, pick = use commit# r, reword = use commit, but edit the comm...

2013-07-02 20:42:06 458

原创 rvm create gemset

[code="ruby"]rvm ruby-1.9.3-p429 do rvm gemset create union[/code]

2013-07-01 09:00:28 305

关于devise结合github通过omniauth登录

最近写了个github帐户登录Demo:[url]https://github.com/yankforce/devise_omniauth_github[/url]演示项目地址:[url]http://devise-github.herokuapp.com[/url]BASIC版本,只是github omniauth,可以参考这个[url]https://g...

2013-06-24 04:47:31 232

原创 在ubuntu中.profile 和.bashrc的加载区别

总之,profile不只是bash,在启动加载bashrc是bash在,起bash session加载[code="java"].bashrc is for Bash only, while .profile is used by other shells as well.Another important difference is that .profile is us...

2013-06-01 21:38:19 218

原创 ubuntu 13.04 ruby 安装依赖

[code="java"]sudo aptitude install build-essential bison openssl libreadline5 libreadline5-dev curl git-core zlib1g zlib1g-dev libssl-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libmysqlclie...

2013-06-01 20:59:47 154

原创 console for sinatra

[url]git://github.com/sickill/racksh.git[/url]也是用来做同样的事。只是可以模拟http请求[code="ruby"]# make GET request$rack.get uri, params, env# make POST request$rack.post uri, params, env# m...

2013-05-24 21:19:51 113

原创 git revert merge commit

[code="ruby"]0ce2ca0b35f59af267241cf4d40d16a3e13ba6f3df1acf5f54426d30f12c6b4558c3dd922297aae3e19b912404ffd3c153ccac3072dbf22396896d2a#要revert的commit是mergegit revert -m 2 0ce2ca0b35f59af267...

2013-05-07 08:10:14 176

原创 cdata 和 xml xmlParseEntityRef: no name 错误

Problem:An XML parser returns the error “xmlParseEntityRef: no name”Cause:There is a stray ‘&’ (ampersand character) somewhere in the XML text eg. some text & some more textSolution:Solu...

2013-05-04 00:24:31 405

原创 一目了然 rails html xml encode decode

[code="ruby"]1.9.2p320 :001 > require 'htmlentities'1.9.2p320 :002 > c = HTMLEntities.new #=> #1.9.2p320 :003 > c.decode ">" #=> ">"1.9.2p320 :004 > require 'cgi'# => false1.9.2p3

2013-05-03 23:37:38 116

原创 使用scope 链接多个where条件

[code="ruby"] scope :by_category, (lambda do |category_id| where(category_id: category_id) unless category_id.nil? end) scope :by_district, (lambda do |district_id| where(district...

2013-05-02 09:17:32 288

原创 在rspec里使用 route path

[code="ruby"]Rspec.configure do |config| config.include Rails.application.routes.url_helpers ...end[/code]

2013-05-01 20:09:39 102

原创 postgresql install and configure for ubuntu

ABSTRACTPostgreSQL is an object-relational database system that has the features of traditional commercial database systems with enhancements to be found in next-generation DBMS systems. This blog...

2013-04-25 08:13:01 129

原创 Destroying a Postgres DB on Heroku

[code="java"]heroku pg:reset DATABASE[/code]

2013-04-24 10:58:15 93

原创 关于Jquery的plugin使用

[code="js"]// jQuery, the fn property is just an alias to the prototype property.//The jQuery identifier (or $) is just a constructor function, and all instances created with it, inherit from ...

2013-04-14 10:30:32 191

原创 select_tag default value & options

[code="ruby"]#If you are using select_tag without any other helper, then you can do it in html:select_tag "whatever", "VISAMasterCard"#Or with options_for_select:select_tag "whatever", o...

2013-04-10 21:40:04 132

原创 Jquery array remove

[code="js"]Array.prototype.remove = function(el){ return this.splice(this.indexOf(el),1);}var arr = [1,2,3,4,5];arr.remove(4);console.log(arr);//[1,2,3,5]var array = [1,2,3,4,5];...

2013-04-10 21:38:48 182

原创 jquery read table

[code="js"]$('#mytable tr').each(function() { var customerId = $(this).find("td").eq(2).html(); });var items=[], options=[];//Iterate all td's in second column$('#tableId>tbody...

2013-04-10 20:54:03 70

原创 ruby readline的两种写法

[code="ruby"]f = File.read('public/file.csv').readlines = f.each_line.map{|x|x}lines = File.readlines('public/file.csv')[/code]

2013-04-09 10:21:45 750

原创 关于encoding utf-8

一 gem解决方案[url]https://github.com/m-ryan/magic_encoding[/url]二,rake task 解决方案[code="ruby"]desc "Manage the encoding header of Ruby files"task :check_encoding_headers => :environment do f...

2013-04-04 20:55:52 459

原创 我见过最清楚的解释class_eval 和 instance_eval

忘了,看一次就能回忆起来[code="ruby"]class A # defs here go to A puts self # => A class

2013-04-02 07:06:59 151

原创 multiple provider oauth

Allowing users to login with multiple authentication providers brings great benefits but also results in some annoying edge cases. For example, what happens when they login with one provider, logout a...

2013-04-01 11:13:50 92

原创 oauth github和multiple oauth

[url=http://railscasts.com/episodes/241-simple-omniauth]http://railscasts.com/episodes/241-simple-omniauth [/url][url=http://github.com/intridea/omniauth]OmniAuth[/url] is a recently released li...

2013-04-01 11:08:11 95

原创 关于view image

https://github.com/mwaterfall/MWPhotoBrowserhttps://github.com/facebook/three20

2013-03-27 12:05:50 106

原创 使用push在两个tableview或者tableviewcell切换

push segue between the view controllers总之,要把第一个view加NavigationController方便的可以这样[code="java"]Editor > Embed In > Navigation Controller[/code]也可以:[quote]NavigationController -> UIView...

2013-03-27 10:41:58 116

原创 Ruby Jquery 地图,地理信息相关资源

[url=http://railscasts.com/episodes/273-geocoder?view=asciicast]Railscast Geocorder[/url][img]http://asciicasts.com/system/photos/702/original/E273I05.png[/img][url=http://www.rubygeocoder.com...

2013-03-22 20:32:41 76

原创 load migrate file and load

[code="java"]Dir[Rails.root.join('db','migrate','*.rb')].each{|file|require file}Dir[File.dirname(__FILE__) + '/../lib/*.rb'].each do |file| require File.basename(file, File.extname(file))...

2013-03-22 05:52:46 80

原创 Brew update problem

[quote]MBA:~ fortin$ brew updateerror: Your local changes to the following files would be overwritten by merge: expect.rb libiconv.rb ncurses.rb openldap.rb openssh.rb ...

2013-03-22 05:48:03 99

原创 UItableview cell 背景

[code="c"][/code]Here is the most efficient way I have come across to solve this problem, use the willDisplayCell delegate method (this takes care of the white color for the text label backg...

2013-03-20 11:01:53 59

原创 iOS UItableviewcell 点按钮修改cell颜色

[code="c"]@interface MyTableViewController : UITableViewController { UIColor *cellColor;}-(IBAction)click:(id)sender;@implementation MyTableViewController -(IBAction)click:(id)...

2013-03-20 10:58:54 132

原创 change the author of a commit in git?

删除项目里的大文件[code="java"]git filter-branch --index-filter \ 'find -name ''*.mp3'' -or -name ''*.ogg'' | xargs -d''\n'' rm -f'#Suppose you want to remove a file (containing confidential ...

2013-03-19 20:34:05 83

原创 Jquery sort table number

So here is what the column is sorted as: 4,666 141,666 293 341,666 346 461,676This should be sorted as 293 346 4,666 141,666 341,666 ...

2013-03-19 01:01:50 88

原创 update_all

[code="ruby"]Article.limit(2).update_all ["updated_at = :time", time: Time.now], ["created_at > :time", time: Time.now - 12.days]Article.limit(2).update_all ["updated_at = ?", Time.now]list ...

2013-03-13 02:09:20 136

原创 接着上面的母子表单

Creating a new Rails project$ mkdir family# create rvm gemset$ echo "rvm use --create ruby-1.9.2@family"> family/.rvmrc$ cd family# install rails$ gem install rails# cre...

2013-03-12 11:45:06 157

原创 有关嵌套资源的使用,母子表单

[code="ruby"]class Post < ActiveRecord::Base validates_presence_of :name, :title validates_length_of :title, :minimum => 5 has_many :comments has_many :tags accepts_nested_attribu...

2013-03-12 11:43:11 331

原创 set vim as git commit default editor

[code="java"]git config --global core.editor "vim"[/code][code="java"]echo "export EDITOR='vim'" >> ~/.profileexport EDITOR='vim'export VISUAL=vim[/code][code="ruby"]# ~/.bashr

2013-03-11 20:43:47 261

原创 objective c Basic

Passing Data ForwardPassing data forward to a view controller from another view controller. You would use this method if you wanted to pass an object/value from one view controller to another vi...

2013-03-09 10:02:33 112

原创 jquery each and find

[code="js"]$(document).ready(function () { var selectedTable = $('table').eq('9'); $(selectedTable).css('border','10px solid green'); $(selectedTable).find('tr td').each(function(...

2013-03-06 04:14:26 82

原创 find and filter out permission denied

[code="java"]find . 2>/dev/null > files_and_foldersfind . 2>&1 | grep -v 'permission denied' > files_and_foldersfind . 2>/dev/null > some_filefind . 2>&1 | grep -v 'Permission denied' > so...

2013-03-06 04:04:14 74

原创 javascript at IE of trim problem

[code="js"]var ID = document.getElementByID('rep_id').value.trim();[/code][quote]Message: Object doesn't support this property or methodLine: 604Char: 2Code: 0URI: http://test.localh...

2013-03-06 04:02:27 72

agile web development with rails 4th edition 源代码

agile web development with rails 4th edition正式版的对应源代码 就是一些Rails3的项目程序代码

2011-04-25

Agile Web Development with Rails 4th -Final Edition

2011年3月的版本,当时的rails是3.0.5 不是beta版,

2011-04-25

The Rails3 Way, 2nd Edition

Ruby on Rails strips complexity from the development process, enabling professional developers to focus on what matters most: delivering business value via clean and maintainable code. The Rails™ 3 Way is the only comprehensive, authoritative guide to delivering production-quality code with Rails 3. Pioneering Rails expert Obie Fernandez and a team of leading experts illuminate the entire Rails 3 API, along with the idioms, design approaches, and libraries that make developing applications with Rails so powerful. Drawing on their unsurpassed experience and track record, they address the real challenges development teams face, showing how to use Rails 3 to maximize your productivity. Using numerous detailed code examples, the author systematically covers Rails 3 key capabilities and subsystems, making this book a reference that you will turn to again and again. He presents advanced Rails programming techniques that have been proven effective in day-to-day usage on dozens of production Rails systems and offers important insights into behavior-driven development and production considerations such as scalability. Dive deep into the Rails 3 codebase and discover why Rails is designed the way it is—and how to make it do what you want it to do.

2011-04-25

pdf批量修改加水印工具

用来批量修改PDF,有时候要加水印不想一页一页加的时候用

2010-10-14

The RSpec Book

The RSpec Book: Behaviour Driven Development with Rspec, Cucumber, and Friends beta 15版本,包括Rails 3 beta的内容

2010-10-14

Agile Web Development with Rails,Fourth Edition 第四版

没什么好介绍的beta版,pdf 第四版,包括Rails 3的内容。

2010-10-14

linux 驱动开发中文版 2.6内核

linux设备驱动程序第三版中文版,绝对经典,大家都是识货的,不用我多说了-Linux Device Driver for the third edition of the Chinese version. Absolute classics, and we are all know what's what, I do not have to talk a lot

2009-03-29

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除