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
<p>The PubAPI is a read-only REST API that responds with JSON-LD data. Our goal is to re-package all currently public data from the website and make it available via the PubAPI. "Public Data" is information available to people who are not logged in, such as player data, game data, and club/tournament information. This excludes private information that is restricted to the logged in user, such as game chat and conditional moves.</p> | |
<p>This is read-only data. You cannot send game-moves or other commands to Chess.com from this system. If you wish to send commands, you will be interested in the Interactive API releasing later this year.</p> | |
<p>To use the PubAPI:</p> | |
<ol> | |
<li>determine the data you want, and compose the URL for it based on the endpoint URL pattern</li> | |
<li>request that URL in your browser, program, <a href="https://www.getpostman.com/">Postman</a>, cURL, or <a href="https://en.wikipedia.org/wiki/IP_over_Avian_Carriers">pigeon</a>.</li> | |
<li>enjoy the JSON <img src="https://www.chess.com/bundles/we |
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 A { | |
public $property = "Default Value"; | |
} | |
function clone_and_modify(A $obj) { | |
$cloned = clone $obj; | |
$cloned->property = "Modified Value"; |
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 | |
define('F_NUMBER', 25); | |
function factorial($in) { | |
// 0! = 1! = 1 | |
$out = '1'; | |
// Only if $in is >= 2 | |
for ($i = 2; $i <= $in; $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
<?php | |
// Emulate register_globals on | |
if (!ini_get('register_globals')) { | |
$superglobals = array($_SERVER, $_ENV, $_FILES, $_COOKIE, $_POST, $_GET); | |
if (isset($_SESSION)) { | |
array_unshift($superglobals, $_SESSION); | |
} | |
foreach ($superglobals as $superglobal) { | |
extract($superglobal, EXTR_SKIP); | |
} |
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
> db.user_posts.runCommand( "text" , { search: "сердце",project:{"user":1, "posts.$.post":1,_id:0},limit: 3 } ) | |
{ | |
"queryDebugString" : "сердц||||||", | |
"language" : "russian", | |
"results" : [ | |
{ | |
"score" : 0.625, | |
"obj" : { | |
"posts" : [ | |
{ |
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
> db.user_posts.runCommand( "text" , { search: "сердце",project:{"user":1, "posts.post":1,_id:0},limit: 3 } ) | |
{ | |
"queryDebugString" : "сердц||||||", | |
"language" : "russian", | |
"results" : [ | |
{ | |
"score" : 0.625, | |
"obj" : { | |
"posts" : [ | |
{ |
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
services: | |
# handler.user_creation: | |
# class: PrestoHeads\BrainGames\CoreBundle\Handler\UserCreationHandler | |
# arguments: [@monolog.logger, @doctrine_mongodb.odm.document_manager] | |
current_time: | |
class: PrestoHeads\BrainGames\CoreBundle\DateTime\CurrentDateTime | |
assignment_publisher: | |
class: PrestoHeads\BrainGames\CoreBundle\Assignment\AssignmentPublisher | |
arguments: [@doctrine_mongodb.odm.document_manager, @logger] |
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
{ | |
"_id" : ObjectId("52e7c9744947253b568b4567"), | |
"avatar" : "http://cs5422.vk.me/u3688507/d_ada9050a.jpg", | |
"contract" : "12345", | |
"contractRequest" : { | |
"_id" : ObjectId("52e7f93c4947253b568b4568"), | |
"firstname" : "Сергей", | |
"lastname" : "Смирнов", | |
"address" : "Домашний Адрес", | |
"phone" : "+111111111", |
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 | |
namespace PrestoHeads\BrainGames\CoreBundle\Controller; | |
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | |
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; | |
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
use Symfony\Component\Form\AbstractType; | |
use Symfony\Component\HttpFoundation\Request; |
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
{# | |
This file is part of the Sonata package. | |
(c) Thomas Rabaix <[email protected]> | |
For the full copyright and license information, please view the LICENSE | |
file that was distributed with this source code. | |
#} |