`
文章列表
  对接企业微信应答:https://github.com/lanrion/qy_wechat (对应公众号gem:https://github.com/lanrion/weixin_rails_middleware) 安装 目前只有Master稳定版本,务必通过: gem 'qy_wechat', git: 'https://github.com/lanrion/qy_wechat.git' 安装。 使用 示例:https://github.com/lanrion/qy_wechat_example rails g qy_wechat:install rails ...
微信API access_token 验证 weixin_authorize https://github.com/lanrion/weixin_authorize WeixinAuthorize Installation Add this line to your application's Gemfile: gem 'weixin_authorize'
Twitter ratchet , 类似于bootstrap,不过专注于mobile,笔者用过在实际项目中,压缩后非常小,十分适合在mobile中使用。 查看官方网站: http://goratchet.com/components/ 同时也快速包装了一个Rails 的gem:  主要依赖于  Ratchet v2.0.1  https://github.com/lanrion/twitter_ratchet_rails 
  GEM https://github.com/lanrion/weixin_rails_middleware EXAMPLE https://github.com/lanrion/weixin_rails_middleware_example     自动验证微信请求。 无需拼接XML格式,只需要使用 WeixinMessageHelper 辅助方法,即可快速回复。 使用方法:render xml: reply_text_message(current_message.ToUserName, current_message.FromUserName, " ...
2014年的想完整读完的书: 越来越想重新补一下 Java,想再重新看一下《Java 编程思想》,里面的思想确实很值得再思考一番。   还有《设计模式》,《HTTP、TCP》,还有数据库,这些补起来,所需要花的时间并不会太多,但需要比较完整的时间,这几种之前都有陆续看书,但因为工作的原因,经常断掉。难度程度属于稍微轻松。   稍微难的基础知识:《编译原理》《操作系统》,这两个应该挺要我命的,所以《算法》暂时不管。   以上是我个人的技术修养方面的提升,多少跟工作没多大直接关系。   人活着,没钱不行。但工资的高低取决于 你能做什么。   过年放假半个月,除了要写一个关于营销 ...
我的github账号:https://github.com/lanrion 我的微博: http://www.weibo.com/denghuaitao   今天结束了一个项目,http://www.essaywit.com 。 功能都挺简单,一个购物车,订单,支付,订单服务, 会话管理,三个角色, 导师,学生,管理员,功能 ...
sort_collections:https://github.com/lanrion/sort_collections   这个gem的目的是,当我们通过API接收数据的时候(没有使用ActiveRecord),会出现需要对当前数组进行排序,Ruby中已经提供了sort方法,但是该方法,只是对简单的String、Integer等类型排序,如果是Hash呢?我需要针对Hash里的某个key进行排序呢? 这个 sort_collections:https://github.com/lanrion/sort_collections 就是解决这个问题的。   安装 gem 'sort_co ...
前一个月专门写了一个Ruby版本的百度API( http://developer.baidu.com/dev), 取名 api4baidu,Github地址: https://github.com/lanrion/baidu Rubygems: https://rubygems.org/gems/api4baidu   具体用法,在这里引用一下 homepage里的README   在Gemfile 安装: gem "api4baidu"   配置你的应用信息:   $client = Baidu.configure do |config| co ...
require: require(filename) -> true or false Ruby tries to load the library named string, returning true if successful. If the filename does not resolve to an absolute path, it will be searched for in the directories listed in $:. If the file has the extension ``.rb’’, it is loaded as a source fi ...
CMS 在百度百科的解释为 CMS是Content Management System的缩写,意为"内容管理系统",它具有许多基于模板的优秀设计,可以加快网站开发的速度和减少开发的成本。    按我的简单理解其实就是一个可视化的编辑,最直观的理解就是iteye现在这个博客发表编辑功能,先上refinerycms的截图:     很酷吧!   如果你是新手,现在肯定在想这个是怎么跑进来的,不过在介绍使用之前,先介绍一下refinerycms吧。   引用官方介绍是最好的了 Refinery CMS, 写道   Refinery CMS, often s ...
Ruby使用include和extend来对class做补充。 假设有一个module: module Person def about_me puts "This is about me." end end   1, include <module name>   1.1 使模块的方法变成类的实例方法: class Student include Person end student = Student.new student.about_me # puts "This is about me.&q ...
Rails 为route的路由约束提供了constraints 方法,具体的使用如下: 限制IP地址constraints(:ip => /192.168.\d+.\d+/) do resources :posts end  可以提供一个ip或者一个ip地址的范围进行限制,一旦检测到用户的ip地址符合限制范围,则会告知不存在此route。 匹配动态请求这个例子是控制route只能被iPhone访问。1,第一种做法,传递block,如下:constraints(lambda { |req| req.env["HTTP_USER_AGENT"] =~ ...
Global site tag (gtag.js) - Google Analytics