rake --tasks
New item has been created. View it here
1More
Security/Server Side TLS - MozillaWiki - 0 views
-
The goal of this document is to help operational teams with the configuration of TLS on servers. All Mozilla sites and deployment should follow the recommendations below. The Operations Security (OpSec) team maintains this document as a reference guide to navigate the TLS landscape. It contains information on TLS protocols, known issues and vulnerabilities, configuration examples and testing tools. Changes are reviewed and merged by the OpSec team, and broadcasted to the various Operational teams.
博客來-代碼之殤(原書第2版) - 2 views
31More
The Rails Command Line - Ruby on Rails Guides - 0 views
- ...28 more annotations...
-
rails dbconsole figures out which database you're using and drops you into whichever command line interface you would use with it
-
The console command lets you interact with your Rails application from the command line. On the underside, rails console uses IRB
-
rake about gives information about version numbers for Ruby, RubyGems, Rails, the Rails subcomponents, your application's folder, the current Rails environment name, your app's database adapter, and schema version
-
You can precompile the assets in app/assets using rake assets:precompile and remove those compiled assets using rake assets:clean.
-
You can also use custom annotations in your code and list them using rake notes:custom by specifying the annotation using an environment variable ANNOTATION.
-
rake routes will list all of your defined routes, which is useful for tracking down routing problems in your app, or giving you a good overview of the URLs in an app you're trying to get familiar with.
-
Using generators will save you a large amount of time by writing boilerplate code, code that is necessary for the app to work.
-
With a normal, plain-old Rails application, your URLs will generally follow the pattern of http://(host)/(controller)/(action), and a URL like http://(host)/(controller) will hit the index action of that controller.
-
A scaffold in Rails is a full set of model, database migration for that model, controller to manipulate it, views to view and manipulate the data, and a test suite for each of the above.
Junior - A front-end framework for building HTML5 mobile apps with a native look and feel. - 0 views
鳥毅的Blog: 在.Net呼叫Java Library - 0 views
tpcc-mysql : Code : percona-tools - 0 views
5More
The Flatiron School | Why You Don't Need Has_and_belongs_to_many... - 0 views
-
When creating associations between models, you almost never know how this relationship will blossom as your application grows.
-
setup a solid has_many :through relationship with an associated join table, you provide yourself with a huge amount of flexibility down the road.
- ...2 more annotations...
-
You should use has_many :through if you need validations, callbacks, or extra attributes on the join model
Duet Display - 0 views
83More
The Asset Pipeline - Ruby on Rails Guides - 0 views
-
adds the ability to write these assets in other languages and pre-processors such as CoffeeScript, Sass and ERB
- ...80 more annotations...
-
Starting with version 3.1, Rails defaults to concatenating all JavaScript files into one master .js file and all CSS files into one master .css file
-
In production, Rails inserts an MD5 fingerprint into each filename so that the file is cached by the web browser
-
The technique sprockets uses for fingerprinting is to insert a hash of the content into the name, usually at the end.
-
The sass-rails gem is automatically used for CSS compression if included in Gemfile and no config.assets.css_compressor option is set.
-
When a filename is unique and based on its content, HTTP headers can be set to encourage caches everywhere (whether at CDNs, at ISPs, in networking equipment, or in web browsers) to keep their own copy of the content
-
app/assets is for assets that are owned by the application, such as custom images, JavaScript files or stylesheets.
-
lib/assets is for your own libraries' code that doesn't really fit into the scope of the application or those libraries which are shared across applications.
-
vendor/assets is for assets that are owned by outside entities, such as code for JavaScript plugins and CSS frameworks.
-
By default these files will be ready to use by your application immediately using the require_tree directive.
-
By default, this means the files in app/assets take precedence, and will mask corresponding paths in lib and vendor
-
if you add an erb extension to a CSS asset (for example, application.css.erb), then helpers like asset_path are available in your CSS rules
-
If you add an erb extension to a JavaScript asset, making it something such as application.js.erb, then you can use the asset_path helper in your JavaScript code
-
data URI — a method of embedding the image data directly into the CSS file — you can use the asset_data_uri helper.
-
Sprockets will also look through the paths specified in config.assets.paths, which includes the standard application paths and any paths added by Rails engines.
-
sass-rails provides -url and -path helpers (hyphenated in Sass, underscored in Ruby) for the following asset classes: image, font, video, audio, JavaScript and stylesheet.
-
The require_tree directive tells Sprockets to recursively include all JavaScript files in the specified directory into the output.
-
manifest files contain directives — instructions that tell Sprockets which files to require in order to build a single CSS or JavaScript file.
-
Directives are processed top to bottom, but the order in which files are included by require_tree is unspecified.
-
You need not supply the extensions explicitly. Sprockets assumes you are requiring a .js file when done from within a .js file
-
Rails 4 creates both app/assets/javascripts/application.js and app/assets/stylesheets/application.css regardless of whether the --skip-sprockets option is used when creating a new rails application.
-
Additional layers of preprocessing can be requested by adding other extensions, where each extension is processed in a right-to-left manner
-
In development mode, assets are served as separate files in the order they are specified in the manifest file.
-
when these files are requested they are processed by the processors provided by the coffee-script and sass gems and then sent back to the browser as JavaScript and CSS respectively.
-
By default Rails assumes that assets have been precompiled and will be served as static assets by your web server
-
If you set config.assets.initialize_on_precompile to false, be sure to test rake assets:precompile locally before deploying
-
By default Rails assumes assets have been precompiled and will be served as static assets by your web server.
-
The X-Sendfile header is a directive to the web server to ignore the response from the application, and instead serve a specified file from disk
11More
Embracing REST with mind, body and soul « Plataformatec Blog - 0 views
-
gain with respond_with introduction is more obvious if you compare index, new and show actions
-
you can define supported formats at the class level and tell in the instance the resource to be represented by those formats.
-
when a request comes, for example with format xml, it will first search for a template at users/index.xml. If the template is not available, it tries to render the resource given (in this case, @users) by calling :to_xml on it
- ...6 more annotations...
-
Your controller code just have to send the resource using respond_with(@resource) and respond_with will call ActionController::Responder which will know what to do.
-
Anything that responds to :call can be a responder, so you can create your custom classes or even give procs, fibers and so on.
40More
Asset Pipeline - Ruby on Rails 指南 - 0 views
-
清单文件或帮助方法
- ...36 more annotations...
-
程序中使用了 jQuery 代码库和许多模块,都保存在 lib/assets/javascripts/library_name 文件夹中,那么 lib/assets/javascripts/library_name/index.js 文件的作用就是这个代码库的清单。清单文件中可以按顺序列出所需的文件,或者干脆使用 require_tree 指令。
-
require_tree 指令告知 Sprockets 递归引入指定文件夹中的所有 JavaScript 文件。文件夹的路径必须相对于清单文件。也可使用 require_directory 指令加载指定文件夹中的所有 JavaScript 文件,但不会递归。
-
不管创建新程序时有没有指定 --skip-sprockets 选项,Rails 4 都会生成 app/assets/javascripts/application.js 和 app/assets/stylesheets/application.css
-
如果用 CDN 分发静态资源,要确保文件不会被缓存,因为缓存会导致问题。如果设置了 config.action_controller.perform_caching = true,Rack::Cache 会使用 Rails.cache 存储静态文件,很快缓存空间就会用完。
-
为 Rails 提供标准 JavaScript 代码库的 jquery-rails gem 是个很好的例子。这个 gem 中有个引擎类,继承自 Rails::Engine。添加这层继承关系后,Rails 就知道这个 gem 中可能包含静态资源文件,会把这个引擎中的 app/assets、lib/assets 和 vendor/assets 三个文件夹加入 Sprockets 的搜索路径中。
Go and the Secure Shell protocol - 0 views
12More
David Verhasselt - Different Ways to Set Attributes in ActiveRecord - 0 views
-
will change the attribute in the model and pass it straight to the database, without running any validations
- ...9 more annotations...
-
set all the attributes you pass it. The changes are not saved to the database. Any attributes you don’t pass will be left unchanged
-
runs an SQL UPDATE query that updates the attributes of all objects without running any validations or callbacks
JPEXS Free Flash Decompiler - Opensource SWF decompiler and editor - 0 views
View AllMost Active Members
View AllTop 10 Tags
- 151system
- 133programming
- 102docker
- 101rails
- 89development
- 83devops
- 81kubernetes
- 80javascript
- 77database
- 71ruby
- 68linux
- 64web
- 61server
- 58networking
- 52security
- 49python
- 42mysql
- 42php
- 40framework
- 35performance