`
小嗷喏
  • 浏览: 51139 次
  • 性别: Icon_minigender_1
  • 来自: 石家庄
社区版块
存档分类
最新评论
文章列表
      mongoose 使用 population 填充`关联表`数据      博文已迁至 http://aikin.github.io/2014/11/02/mongoose-population
 gulp-nodemon 和 gulp-livereload 配置    迁移 Gulp API 初探和 gulp-nodemon gulp-livereload 配置      一、gulp 安装     1. 全局安装: npm install -g gulp     2. 安装在项目开发环境: npm install gulp --save-dev         二、gulp-nodemon 和 gulp-livereload 安装     gulp-nodemon 是重启服务器的插件。     gulp-livereload 后端控制前端同步刷新,不过需 ...
    迁移 http://aikin.me/2014/06/16/ie-iframe-cache/       最近“致力于”调 IE9  、IE10 、 firefox 、 chrome 浏览器对 iframe刷新。 发现在IE浏览器中,有些刷新 iframe 的方法会加载缓存。以下就对一些方法在 IE9 、IE10(以下简称IE)的产生效果介绍一下:       1、对 iframe 的 src 属性重新赋值来实现刷新 $("#iframeId").attr("src", $("#iframeId").attr(& ...
          在 cocos2d-html5,  发现 Sprite 类没有点击事件,需要注册点击的代理, 才能接受点击事件。下面一段代码写了一个可以接受点击事件的 DemoSprite 类。     var DemoSprite = cc.Sprite.extend({ _touchBegan: false, _touchEnabled: true, ctor: function (image) { this._super(); this.init(image); }, onEnt ...
      当使用 Rails 的 validates 对 User Model 的属性添加限制条件; 用户注册时,提示的信息将出现英文。  下面介绍如何将这些英文翻译成中文。        1. 请在 User Model中加入下面代码: validates :name, :presence => true, :uniq ...
    迁移 http://aikin.me/2014/03/16/ios7-uinavigationcontroller-uiview/  在 iOS 7 中,如果某个 UIViewController 的 self.view 第一个子视图是 UIScollView, 同时当这个 UIViewController 被 push 或 initWithRootController 成为 UINavigationController控制的Controller时,这个 UIViewController的 view 的子视图 UIScollView 的所有子视图, 都会被下移 64px。   ...
   转移 http://aikin.me/2014/03/15/mongodb-gui-rockmongo/RockMongo 是一个PHP5写的,开源的 MongoDB 管理工具。    官网: http://rockmongo.com/wiki/introduction?lang=zh_cn     github: https://github.com/iwind/rockmongo      1. 安装 php:    在终端输入: sudo apt-get install apache2 php5 php5-dev dh-make-php        终端最后几 ...
   Rails 在后台新建用户。   user = User.new({:name=>'admin', :password=>'admin', :password_confirmation => 'admin', :is_amdin => true, :token=>'kajdlioew%^%hjks'}) user.save 或者: user = User.create({:name=> ...
   1. 数组的创建: array = [1, 2, "3", "4"] 或者 array = Array.new array = Array.new(6) #创建[nil, nil, nil, nil, nil, nil] array = Array.new(6, "a") #创建["a", "a", "a", "a", "a", "a"]    也可以使用"%w" ...
   要根据请求端的不同而返回不同的页面,首先就得判断出请求端是pc还是mobile。在http请求时,user_agent这个字段会记录用户所用的设备和浏览器。所以就得对user_agent进行解析,来获取是什么设备。      (1)在Rails项目中,要用到useragent 这个gem 包(https://github.com/josh/useragent)。输入终端命令:   gem install useragent    (2)在rails项目的 Gemfile 中写入: gem 'useragent'    (3) 输入终端命令: bundle install ...
   1.在成功安装ImageMagick了后对图片处理是出现下面错误:  An error was received while processing: #<Paperclip::Errors::NotIdentifiedBy ImageMagickError: Paperclip::Errors::NotIdentifiedByImageMagickError>    错误解决:在Rails项目的config/environments/development.rb文件加入: Paperclip.options[:command_path] = '/opt/ ...
转移 http://aikin.me/2014/02/20/rails-paperclip/    Paperclip是 Rails 的一个上传图片插件,它和ImageMagick联合使用,可以很方便的实现图片上传并切割指定大小的功能,使整个图片上传过程非常简单,还会将上传的图片保存在public文件夹下。    1.下载paperclip gem包  (1)在Gemfile中写上 gem 'paperclip'     (2)在终端运行 bundle install         2.使用paperclip   (1)在终端输入: rails g papercli ...
- (id)init { self = [super init]; if (self) { NSLog(@"0"); } return self; } - (void)viewDidLoad { [superviewDidLoad]; NSLog(@"1"); } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; NSLog(@"2& ...
  在终端运行 pod install 出现下面error [!] Pod::Executable pull Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.    解决方法,在终端输入: gem update --system    接着在输入: sudo gem install cocoapods      ...
 在用户点击注册按钮是 出现 错误 ActiveModel::ForbiddenAttributesError  解决方法一: def create @user = User.new(params[:user]) // 这是被提示有错误。 if @user.save cookies.permanent[:token] = @user.token redirect_to :user_welcome return end render :register end     解决方法, 首先在 use ...
Global site tag (gtag.js) - Google Analytics