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
# / | |
array | |
'action' => string 'mypage' (length=6) | |
'parameters' => | |
array | |
empty | |
# /projects | |
array | |
'action' => string 'projects' (length=8) |
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
<?php | |
class tfObjectRouteCollection extends sfObjectRouteCollection | |
{ | |
public function __construct(array $options) | |
{ | |
$options = array_merge(array( | |
'methods_for_query' => array() | |
), $options); |
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
<?php | |
use \Pwango\Response\HttpResponse; | |
function index(\Pwango\Request $request) | |
{ | |
return new HttpResponse('Index of Projects'); | |
} |
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
import socket, ssl, struct | |
from eppxml.hello import Hello | |
class Client(object): | |
def connect(self, host, port): | |
self.connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
self.connection.setblocking(0) | |
self.connection.settimeout(10) | |
self.connection = ssl.wrap_socket(self.connection) |
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
<?php | |
class sfMessageSource_Doctrine extends sfMessageSource | |
{ | |
public function &loadData($variant) | |
{ | |
$rows = Doctrine_Query::create() | |
->from('TransUnit t') | |
->leftJoin('t.Catalogue c') | |
->where('c.name=?', $variant) |
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/ruby | |
zones_directory = "/var/named/slaves/*.hosts" | |
domains = Dir.glob(zones_directory).collect { |file| File.basename(file).sub(".hosts", "") } | |
domains.each do |domain| | |
print `rndc retransfer #{domain}` | |
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
require 'spec_helper' | |
describe SessionController do | |
it "should show the login page at new action" do | |
get :new | |
response.should be_success | |
end | |
context "authentication failure" do |
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
Feature: User Authentication | |
In order to play the game | |
As an registrered user | |
I want to be able to login | |
Background: | |
Given I have the user "[email protected]" with password "foobar" | |
Scenario: Logging in with incorrect credentials | |
Given I am on the login page |
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
<?php | |
class User | |
{ | |
protected $id; | |
protected $name; | |
public function setId($id) | |
{ | |
$this->id = $id; |
OlderNewer