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
private function getPlayerByLastNameAndSport($lastName,$teamStr,$sport){ | |
$doctrine = $this->getContainer()->get("doctrine"); | |
$em = $doctrine->getManager(); | |
$playerRepo = $em->getRepository("RotoRobotBundle:Player"); | |
$sportsLeagueRepo = $em->getRepository("RotoRobotBundle:SportsLeague"); | |
$teamRepo = $em->getRepository("RotoRobotBundle:Team"); | |
$sportsLeague = $sportsLeagueRepo->findOneBy(["name"=>$sport]); | |
$teamKeys = array( |
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 onPreSetData(FormEvent $event) | |
{ | |
$form = $event->getForm(); | |
$form->add('plainOasPassword', 'text', | |
array( | |
'required'=>false, | |
'label'=>"Oas Password", | |
'attr' => array('placeholder'=>'Existing value is set, but obscured for security purposes') |
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
if($scheduleString){ | |
$formattedSchedule = json_decode($scheduleString); | |
could be shortened to this because json_decode will return false if string doesnt exist or is garbage | |
if($formattedSchedule = json_decode($scheduleString)){ | |
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
California has a population of 37,253,956 | |
Texas has a population of 25,145,561 | |
New York has a population of 19,378,102 | |
Florida has a population of 18,801,310 | |
Illinois has a population of 12,830,632 | |
Pennsylvania has a population of 12,702,379 | |
Ohio has a population of 11,536,504 | |
Michigan has a population of 9,883,640 | |
Georgia has a population of 9,687,653 | |
North Carolina has a population of 9,535,483 |
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
private function scrapePopulationsByState(){ | |
$cssSelector = "table.sk_popcharttable"; | |
$siteUrl = "http://www.ipl.org/div/stateknow/popchart.html"; | |
$tableXmlObject = pullXmlObjBlogExample($siteUrl,$cssSelector); | |
$cnt = 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
public function pullXmlObjBlogExample($siteUrl,$cssSelector){ | |
//create configuration object containing jquery selector and target site url to pass to the phantom script | |
$config = array( | |
"selector"=>$cssSelector, | |
"url"=>$siteUrl | |
); | |
//read in the base phantom script and create a copy of it so we don't mess with the original base script |
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
var page = require('webpage').create(); | |
page.onError = function (msg, trace) { | |
phantom.exit(); | |
}; | |
page.onAlert = function( msg ) { |
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
var page = require('webpage').create(); | |
page.onError = function (msg, trace) { | |
phantom.exit(); | |
}; | |
page.onAlert = function( msg ) { |
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
_ _ _ _ _ _ _ | |
|_| | _||_||_ |_ ||_| _| | |
_| ||_ | _||_| ||_| _| | |
912456783 | |
--------------------------------------------------------------------- | |
package kata; |
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
mysql> select * from user_count order by count desc limit 50; | |
+------------------+-------+ | |
| user | count | | |
+------------------+-------+ | |
| @oracleofmydoc | 12122 | | |
| oracleofmydoc | 12122 | | |
| @nasa | 11322 | | |
| nasa | 11322 | | |
| @designsbylilla | 10626 | | |
| designsbylilla | 10626 | |
NewerOlder