- 浏览: 2077668 次
- 性别:
- 来自: NYC
最新评论
-
dadadada2x:
user模型里加上 protected def email ...
流行的权限管理 gem devise的定制 -
Sev7en_jun:
shrekting 写道var pattern = /^(0| ...
强悍的ip格式 正则表达式验证 -
jiasanshou:
好文章!!!
RPM包rpmbuild SPEC文件深度说明 -
寻得乐中乐:
link_to其实就是个a标签,使用css控制,添加一个参数: ...
Rails在link_to中加参数 -
aiafei0001:
完全看不懂,不知所然.能表达清楚一点?
"$ is not defined" 的问题怎么办
文章列表
Railscast Geocorder
Geocorder 官网
Geokit
Jquery solution
https://code.google.com/p/jquery-ui-map/
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))
end
rails console
>> require "db/migrate/20090408054532_add_foos.rb"
>> AddFoos.up
...
引用
MBA:~ fortin$ brew update
error: Your local changes to the following files would be overwritten by merge:
expect.rb
libiconv.rb
ncurses.rb
openldap.rb
openssh.rb
perl.rb
tcl.rb
tk.rb
Please, commit your changes or stash them before you can merge.
Aborting
Error: Fai ...
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 background as well when using cell.textLabel.text and/or cell.detailTextLabel.text):
- (void)tableView:(UITableView *)tableVi ...
@interface MyTableViewController : UITableViewController {
UIColor *cellColor;
}
-(IBAction)click:(id)sender;
@implementation MyTableViewController
-(IBAction)click:(id)sender{
cellColor = [UIColor redColor];
[self.tableView reloadData];
}
- (UITable ...
删除项目里的大文件
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 information or copyright violation) from all commits:
git filter-branch --tree-filter 'rm filename' HEAD
g ...
So here is what the column is sorted as:
4,666
141,666
293
341,666
346
461,676
This should be sorted as
293
346
4,666
141,666
341,666
461,676
$(document).ready(function() {
$.tablesorter.addParser({
id: 'fancyNumber',
is:f ...
update_all
- 博客分类:
- Ruby On Rails
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 = File.read(Rails.root.join('doc','free_stories.txt')).split("\r\n").ma ...
接着上面的母子表单
- 博客分类:
- Ruby On Rails
Creating a new Rails project
$ mkdir family
# create rvm gemset
$ echo "rvm use --create ruby-1.9.2@family"> family/.
有关嵌套资源的使用,母子表单
- 博客分类:
- Ruby On Rails
class Post < ActiveRecord::Base
validates_presence_of :name, :title
validates_length_of :title, :minimum => 5
has_many :comments
has_many :tags
accepts_nested_attributes_for :tags, :allow_destroy => :true ,
:reject_if => proc { |attrs| attrs.all? { |k, v| v.blan ...
git config --global core.editor "vim"
echo "export EDITOR='vim'" >> ~/.profile
export EDITOR='vim'
export VISUAL=vim
# ~/.bashrc
export GIT_EDITOR='/Applications/MacVim.app/Contents/MacOS/Vim -g '
When I issue
git commit
then I get a macvim editor but on th ...
objective c Basic
- 博客分类:
- ios
Passing Data Forward
Passing 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 view controller that you may be pushing on to a navigation stack.
For this example we will have ViewContro ...
$(document).ready(function () {
var selectedTable = $('table').eq('9');
$(selectedTable).css('border','10px solid green');
$(selectedTable).find('tr td').each(function(i) {
$(this).css('border','10px solid blue');
});
});
<!DOCTYPE html>
<html> ...
find . 2>/dev/null > files_and_folders
find . 2>&1 | grep -v 'permission denied' > files_and_folders
find . 2>/dev/null > some_file
find . 2>&1 | grep -v 'Permission denied' > some_file
How can I exclude all “permission denied”-messages from “find .”?
var ID = document.getElementByID('rep_id').value.trim();
引用
Message: Object doesn't support this property or method
Line: 604
Char: 2
Code: 0
URI: http://test.localhost/test.js
if(typeof String.prototype.trim !== 'function') {
String.prototype.trim = function() {
return this.replac ...