Let's say you want to host domains first.com
and second.com
.
Create folders for their files:
user web; | |
# One worker process per CPU core. | |
worker_processes 8; | |
# Also set | |
# /etc/security/limits.conf | |
# web soft nofile 65535 | |
# web hard nofile 65535 | |
# /etc/default/nginx |
#encoding: utf-8 | |
require 'spreadsheet' | |
xls_file_name = "/tmp/status_data.xls" | |
xls_book = Spreadsheet.open(xls_file_name, "rb") | |
xls_book.worksheet(0).each do |row| | |
puts row[6].value if row[6] and row[6].is_a?(Spreadsheet::Formula) |
--- a/rails-1.2.6/lib/dispatcher.rb | |
+++ b/rails-1.2.6/lib/dispatcher.rb | |
@@ -41,7 +41,7 @@ | |
controller.process(request, response).out(output) | |
end | |
rescue Exception => exception # errors from CGI dispatch | |
- failsafe_response(output, '500 Internal Server Error', exception) do | |
+ failsafe_response(output, '500 Internal Server Error', exception, response) do | |
controller ||= (ApplicationController rescue ActionController::Base) | |
controller.process_with_exception(request, response, exception).out(output) |
Fix for FOUC :
At the top of your HTML:
<!doctype html>
<html>
<head>
<style>html{visibility: hidden;opacity:0;}</style>
uses | |
WinSpool; | |
procedure TFrmMain.btnImprimir(Sender: TObject); | |
var | |
Handle: THandle; | |
CaracteresImpressos: DWORD; | |
Documento: TDocInfo1; | |
TextoAnsiString : AnsiString; | |
TextoUnicode: string; |
To comment a single line use | |
<%-# commented line -%> | |
This also works | |
<%# my comment %> | |
To comment a whole block use a if false to surrond your code like this |
Cheat Sheets are greate but they are not a substitute for learning the framework and reading the documentation as we most certainly have not covered every potential example here. Please refer to the Rails Command Line Docs for more information.
You can get all of this information on the command line.
rails generate
with no generator name will output a list of all available generators and some information about global options.
rails generate GENERATOR --help
will list the options that can be passed to the specified generator.
// uses System, Variants | |
function IsEmptyOrNull(const Value: Variant): Boolean; | |
begin | |
Result := VarIsClear(Value) or VarIsEmpty(Value) or VarIsNull(Value) or (VarCompareValue(Value, Unassigned) = vrEqual); | |
if (not Result) and VarIsStr(Value) then | |
Result := Value = ''; | |
end; |