This file contains hidden or 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
{ | |
init: function(elevators, floors) { | |
var elevator = elevators[0]; // Let's use the first elevator | |
_.each(floors, function(floor) { | |
floor.on("up_button_pressed down_button_pressed", function() { | |
elevator.goToFloor(floor.floorNum()); | |
}); | |
}); | |
This file contains hidden or 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
upstream php5438 { | |
server 127.0.0.1:5438; | |
} |
This file contains hidden or 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
<VirtualHost *:80> | |
ServerName 10.10.0.3 | |
DocumentRoot /home/vagrant/htdocs/apad2/app/webroot | |
<Directory /home/vagrant/htdocs/apad2/app/webroot> | |
Options Indexes FollowSymLinks MultiViews | |
AllowOverride All | |
Require all granted | |
</Directory> | |
ErrorLog ${APACHE_LOG_DIR}/error-apad.log |
This file contains hidden or 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 | |
// Validates tenant | |
switch (isset($this->request->params['tenant'])) { | |
case true: | |
// The tennant should exist | |
$this->loadModel('Tenant'); | |
if ($this->Tenant->isExist($this->request->params['tenant']) == 0) { | |
throw new NotFoundException(); | |
} |
This file contains hidden or 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 RebuildAroShell extends AppShell { | |
public $uses = array('User', 'Group'); | |
public function main() { | |
$groups = $this->Group->find('all'); | |
$users = $this->User->find('all'); | |
$aro = new Aro(); |
This file contains hidden or 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
Warning: Setting DYLD_* vars can break dynamic linking. | |
Set variables: | |
DYLD_FALLBACK_LIBRARY_PATH | |
Warning: "config" scripts exist outside your system or Homebrew directories. | |
`./configure` scripts often look for *-config scripts to determine if | |
software packages are installed, and what additional flags to use when | |
compiling and linking. | |
Having additional scripts in your path can confuse software installed via |
This file contains hidden or 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
set :stage, :staging | |
server "example.com", roles: [:app, :web, :db] | |
set :ssh_options, { | |
user: "william", | |
forward_agent: true | |
} | |
set :deploy_to, "/home/william/htdocs/#{fetch(:application)}" | |
set :deploy_via, :remote_cache |
This file contains hidden or 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 | |
// The Slim Framework helps you map resource URIs to callback functions | |
// for specific HTTP request methods (e.g. GET, POST, PUT, DELETE, OPTIONS or HEAD). | |
// A Slim application will invoke the first route that matches | |
// the current HTTP request’s URI and method. | |
// If the Slim application does not find routes with URIs that match | |
// the HTTP request URI and method, it will automatically | |
// return a 404 Not Found response. |
This file contains hidden or 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
from itertools import combinations | |
teams = ["Packers", "49ers", "Ravens", "Patriots"] | |
for game in combinations(teams, 2): | |
print game | |
# => ('Packers', '49ers') | |
# => ('Packers', 'Ravens') | |
# => ('Packers', 'Patriots') | |
# => ('49ers', 'Ravens') |