flowerwrong的博客
flowerwrong · 共 143 篇文章
google java code style
https://google-styleguide.googlecode.com/svn/trunk/javaguide.html https://code.google.com/p/google-styleguide/ https://github.com/styleguide/javascript
2014-11-22 23:34 · java企业架构 · 评论(0)
google js 代码规范
http://alloyteam.github.io/JX/doc/specification/google-javascript.xml http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml
2014-11-22 23:25 · javascript · 评论(0)
whenever no crontab
# http://stackoverflow.com/questions/7548730/cron-job-not-working-in-whenever-gem whenever --update-crontab sudo service cron restart crontab -l
2014-11-18 22:14 · gem · 评论(0)
rubocop 最佳实践
# class definition is too long # This likely means that your class definition takes more than 100 lines of code. # missing top-level class documentation comment # # use only ascii symbols in comments(不能使用中文) # # favor modifier if usage when having a single-line body if token_reg =~ res.to_s @token …
2014-11-18 13:53 · gem · 评论(0)
ubuntu vim 使用技巧
# 打开新的tab ctrl + shift + T # 关闭标签页 ctrl + shift + Q # 标签页切换 ctrl + pgup/pgdn # 查找并打开文件 cd ./blog set path=.,page/,src/ # vim :find msgs_controller.rb # 支持table键 # 也可以使用 lookupfile 插件 # 选择行 esc模式下 v: 按字符选择 V: 按行选择 ctrl+v: 按块选择 y/d # 设置回车后的默认空格数 set shiftwidth=2
2014-11-18 12:51 · ubuntu · 评论(0)
waiting apache2: Could not reliably determine the server's fully qualified domai
ubuntu 12.04 waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName 解决方法 # http://aslamnajeebdeen.com/blog/how-to-fix-apache-could-not-reliably-determine-the-servers-fully-qualified-domain-name-using-127011-for-servername-error-on-ubun…
2014-11-15 14:53 · ubuntu · 评论(0)
rails devise Completed 401 Unauthorized && can't verify csrf token authenticity
最近做项目的时候,由于时间紧,做得太快,没注意细节,导致一些错误. 11.05更新: 偶尔又会出现问题,清理历史记录后就好了!!! 1.can't verify csrf token authenticity google了很久之后通过 class ApplicationController < ActionController::Base # Prevent CSRF attacks by raising an exception. # For APIs, you may want to use :null_session instead. # protect_from_forgery w…
rails 4 自定义脚手架配置
一.建立rails 4 项目 rails -v # => 4.1.7 rails new customgenerator --skip-bundle # edit the gem source in Gemfile cd customgenerator bundle install rails s # visit http://127.0.0.1:3000/ 二.添加脚手架配置 # in application.rb config.generators do |g| g.orm :active_record g.template_engine :erb # g.test_framework …
devise cancancan rolify 权限认证
http://d.hatena.ne.jp/htz/20140718/1405690417 http://www.tonyamoyal.com/2010/07/28/rails-authentication-with-devise-and-cancan-customizing-devise-controllers/ http://arubystory.blogspot.com/2013/12/creating-simple-todo-application-with.html http://railscasts.com/episodes/192-authorization-with-canc…
cap production deploy时候public/uploads文件夹内容无法共享解决办法
http://stackoverflow.com/questions/9043662/carrierwave-files-with-capistrano # cap 3.2 # in config/deploy.rb set :linked_dirs, fetch(:linked_dirs) + %w{public/system public/uploads} cap production deploy:check:linked_dirs cap production deploy:symlink:shared # cap 2 # config/deploy.rb set :shared_c…
2014-10-31 16:21 · rails · 评论(0)
JavaScript高级程序设计事件笔记
一.dom0级事件 on+事件名称 onclick 二.dom2级事件 addEventListener removeEventListener 三.ie事件处理程序 attachEvent detachEvent 四.事件流 dom2 级事件流包括三个阶段 事件捕获阶段,处于目标阶段,事件冒泡阶段 五.事件对象event 事件类型《ui事件,焦点事件,鼠标事件,滚轮事件,文本事件,键盘事件,合成事件,变动事件,变动名称事件》 六.事件委托 例如ul下有五个li,不用对每个li绑定事件,委托给ul就行。
2014-10-28 23:25 · javascript · 评论(0)
ubuntu 14.04 安装 redis stable
wget http://download.redis.io/redis-stable.tar.gz tar xvzf redis-stable.tar.gz cd redis-stable make make test sudo make install cd utils sudo ./install_server.sh sudo service redis_6379 start|stop # 开发默认启动 sudo update-rc.d redis_6379 defaults http://redis.io/topics/quickstart http://happycasts.gith…