This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UpdateConfirmedUserView < ActiveRecord::Migration | |
self.up | |
execute `git show 2d308a6:sql/confirmed_users_view.sql` | |
end | |
self.down | |
execute `git show 1596b6d:sql/confirmed_users_view.sql` | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE VIEW confirmed_user AS | |
SELECT * FROM users WHERE confirmed_at IS NOT NULL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UpdateConfirmedUserView < ActiveRecord::Migration | |
self.up | |
execute <<-EOF | |
CREATE OR REPLACE VIEW confirmed_user AS | |
SELECT * FROM users WHERE confirmed_at IS NOT NULL | |
AND disable IS FALSE; | |
EOF | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreateConfirmedUserView < ActiveRecord::Migration | |
self.up | |
execute <<-EOF | |
CREATE VIEW confirmed_user AS | |
SELECT * FROM users WHERE confirmed_at IS NOT NULL; | |
EOF | |
end | |
self.down |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in config/environments/production.rb : | |
# Make sure the cookie is secure | |
ActionController::Base.session_options[:secure] = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in config/environment.rb : | |
config.action_controller.session = { | |
:key => '_myapp_session', | |
:secret => 'super_very_long_key_more_than_30_chars', | |
#:secure => true, # Only enable secure here if your dev env is using ssl, which is certainly not the case | |
:expire_after => 3600 # 1 hour | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in config/environment.rb: | |
config.action_controller.session = { | |
:key => '_myapp_session', | |
:secret => 'super_very_long_key_more_than_30_chars' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/rackup | |
#\ -w -p 8765 | |
map '/' do | |
run Proc.new {|env| | |
req = Rack::Request.new(env) | |
if req.params['PARAM1'] and req.params['PARAM2'] and req.params['PARAM3'] and req.params['PARAM4'] and req.params['PARAM5'] and env['HTTP_HEADER1'] and env['HTTP_HEADER2'] | |
[200, {"Content-Type" => "text/html"}, ["Data Sent"]] | |
else | |
puts req.params |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> | |
<xs:include schemaLocation="./include/CJCommon.xsd" /> | |
<xs:element name="OUVINFOPERSO"> | |
<xs:complexType> | |
<xs:sequence minOccurs="1" maxOccurs="1"> | |
<!-- Entete --> | |
<xs:element minOccurs="1" maxOccurs="1" ref="IDOper" /> | |
<xs:element minOccurs="1" maxOccurs="1" ref="DateEvt" /> | |
<xs:element minOccurs="1" maxOccurs="1" ref="IDEvt" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env ruby | |
# Typhoeus::Multi bug demo | |
require 'rubygems' | |
require 'typhoeus' | |
e = Typhoeus::Easy.new | |
e.url= "https://www.google.com" | |
e.method = :post | |
e.headers = {:TEST => "TEST"} |