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 GetEventResult | |
@queue = :events | |
def self.perform(event_id, attempt=0) | |
event = Event.find(event_id) | |
Rails.logger.info "Fetching results for event ##{event.id} (#{event.name})..." | |
begin | |
results = EventImporter.new(event.datetime.to_date).get_results(event) | |
rescue OpenURI::HTTPError |
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
ENV["RAILS_ENV"] = "test" | |
require File.expand_path(File.dirname(__FILE__) + "/../config/environment") | |
require 'test_help' | |
require 'authlogic/test_case' | |
class ActiveSupport::TestCase | |
[...] | |
end | |
module Resque |
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
^\w{3} [ :0-9]{11} [._[:alnum:]-]+ suhosin\[[0-9]+\]: ALERT - canary mismatch on efree() - heap overflow detected (attacker '[0-9a-f.:]{3,39}', file '/var/www/openx/www/delivery/[[:alpha:]]+\.php')$ |
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
# Copyright (c) 2010 Tech-Angels | |
# | |
# Permission is hereby granted, free of charge, to any person | |
# obtaining a copy of this software and associated documentation | |
# files (the "Software"), to deal in the Software without | |
# restriction, including without limitation the rights to use, | |
# copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the | |
# Software is furnished to do so, subject to the following | |
# conditions: |
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
# Some helpers for Rack-Test (http://github.com/brynary/rack-test) | |
# To use the helper, include RackTestHelper in your test class, then you can access | |
# session[:session_id] or whatever. | |
# Warning : this won't work if you're using more than one cookie, since I'm fetching the first available ! | |
module RackTestHelper | |
#Returns the current session as a HASH | |
def session | |
Marshal.load(Base64.decode64(CGI.unescape(rack_mock_session.cookie_jar.to_hash.values.first))).with_indifferent_access | |
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
#! /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"} |
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/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
# 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
# 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 | |
} |