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
public function validate(array $requiredParams) | |
{ | |
$properties = get_object_vars($this); | |
foreach ($properties as $property => $propValue) { | |
if (array_key_exists($property, $requiredParams) && empty($propValue)) { | |
return false; | |
} | |
} | |
return 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
public function getCages($query, cageQueryParams $params) | |
{ | |
$q = $this->createQuery('c') | |
->leftJoin('c.Strain s') | |
->leftJoin('c.MouseCage m') | |
->where('m.dateout IS NULL'); | |
if($params->strainid) { | |
$q->addWhere('c.strain_id = ?', $params->strainid); |
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
/** | |
* Completes process of moving of mouse to selected cage | |
* | |
* @param sfWebRequest $request | |
* @return json-encoded template | |
*/ | |
public function executeDoMove(sfWebRequest $request) | |
{ | |
$this->checkRequest($request); | |
$this->form = new MouseCageDateInForm(); |
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
<VirtualHost *:80> | |
ServerName zf2-tutorial.localhost | |
DocumentRoot /Users/rowan02/Sites/zf2-tutorial/public | |
SetEnv APPLICATION_ENV "development" | |
<Directory "/Users/rowan02/Sites/zf2-tutorial/public"> | |
Options Indexes FollowSymLinks | |
DirectoryIndex index.php | |
AllowOverride All | |
Order allow,deny | |
Allow from all |
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
$results = $this->query->execute(); | |
$userIdArray = array(1, 4, 7, 9); | |
if ($results->count() > 0) { | |
$users = array(); | |
foreach ($results as $result) { | |
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
Why Mentoring? | |
Why bother? What are the personal reasons to make mentorship something you get involved with? Just what is a role model anyway? Well, generally speaking, a role model is a "person who serves as an example, whose behaviour is emulated by others.“ For reasons to bother and to discover what you could get out of it, keep reading... | |
Mentees: | |
It can really help you get where you want to be in your career if you have the opportunity to see someone who is where you want to be (maybe Bill Gates, Rasmus, ADD A WOMAN HERE?). The following are some of the benefits you can expect to gain from a good mentor relationship: | |
Information: Mentors can help you learn complex tools or processes, review your work, and avoid or resolve problems. | |
Advice: Mentors can share insights you didn’t even know you needed. Mentors can also help you understand your hidden strengths and weaknesses. |
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 | |
/** | |
* Write a function that generates a | |
* random 5 star rating as a decimal | |
* number and outputs the following | |
* strings (in place of star images) | |
* | |
* 'Full Star', | |
* 'Partial Star', |
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 | |
for ($i = 1; $i < 100; $i++) { | |
if ($i % 3 == 0) { | |
echo 'Fizz'; | |
} elseif ($i % 5 == 0) { | |
echo 'Buzz'; | |
} else { | |
echo $i; |
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
SET SESSION storage_engine = "InnoDB"; | |
ALTER DATABASE CHARACTER SET "utf8"; | |
DROP TABLE IF EXISTS post; | |
CREATE TABLE post ( | |
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, | |
author_id INT NOT NULL REFERENCES author(id), | |
slug VARCHAR(100) NOT NULL UNIQUE, | |
title VARCHAR(400) NOT NULL, | |
content MEDIUMTEXT 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
SET SESSION storage_engine = "InnoDB"; | |
DROP DATABASE IF EXISTS demo_blog; | |
CREATE DATABASE demo_blog; | |
USE demo_blog; | |
ALTER DATABASE demo_blog CHARACTER SET "utf8"; | |
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES, CREATE TEMPORARY TABLES ON `blog_demo`.* TO 'Tester'@'localhost' IDENTIFIED BY 'queries'; |