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
people = ['one','two','three','four'] | |
counter = 0; | |
begin | |
person = people[counter] | |
puts person | |
counter = counter + 1 | |
end while not people[counter].nil? |
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
def save = Action { implicit request => | |
val result = postForm.bindFromRequest.fold( | |
{formFail => Ok(views.html.admin.blog.edit(formFail))}, | |
{post => Ok(views.html.blog.post(post))} | |
) | |
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
val postData = request.body.asFormUrlEncoded.get | |
val emptyValue = Seq("") | |
val title = postDate.get("title").getOrElse(emptyValue)(0) |
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
def post(slug: String) = Action { | |
val blogPostOption = postModel.getPost(slug) | |
blogPostOption match { | |
case Some(blogPost) => Ok(views.html.blog.post(blogPost)) | |
case None => Ok(views.html.blog.notfound()) | |
} | |
} |
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 Invoice | |
{ | |
/** | |
* @ORM\OneToMany(targetEntity="InvoiceLine", mappedBy="invoiceId") | |
*/ | |
private $lines; | |
} |
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 com.typesafe.startscript.StartScriptPlugin | |
seq(StartScriptPlugin.startScriptForClassesSettings: _*) | |
name := "hello" | |
version := "1.0" | |
scalaVersion := "2.9.1" |
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
object Uri { | |
def escape(unsafe: String) = { | |
val alphabet = List[String]("a","b","c","e","f","g","h","i","j","k","l","m","n", | |
"o","p","q","r","s","t","u","v","w","x","y","z") | |
var safe = "" | |
unsafe.split("").foreach { char => | |
if (alphabet.indexOf(char.toLowerCase) == -1 && char.forall(_.isDigit) == false) { | |
safe += "%" |
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 | |
$reflection = new ReflectionObject($proxy); | |
$content = $reflection->getProperty('content '); | |
$content->setAccessible(true); | |
$_content = $content->getValue($proxy); | |
$this->assertEquals("content", $_content); | |
/** |
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
Is there any packages that would cause the Model/Entity to return true on a save/update but | |
not actually update the field? | |
I've got a test that passes locally but fails on the Jenkins server. PHP and Mongo Extenstions | |
versions are 5.3.2 and 1.2.6 on the Jenkins server and 5.3.9 and 1.2.6 locally. |
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 | |
$user = User:create(); | |
// Get the validation rules. | |
$userModel = new User(); | |
$rules = $userModel->validates; | |
// Add new | |
$rules['password']['skipEmpty'] = true; | |
$rules['confirm_password'] = array( |