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
| // initializers/cors.js | |
| "use strict"; | |
| var util = require('../lib/utility'); | |
| exports.cors = function(api, next){ | |
| api.log('CORS Origin Header Control', "debug"); | |
| var cors_filter = function(connection, actionTemplate, next){ | |
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 | |
| namespace Acme\Bundle\AcmeBundle\EventListener; | |
| use Symfony\Component\HttpKernel\Event\GetResponseEvent; | |
| use Symfony\Component\HttpKernel\KernelEvents; | |
| use Symfony\Component\HttpFoundation\Request; | |
| use Symfony\Component\Routing\RequestContextAwareInterface; | |
| use Symfony\Component\EventDispatcher\EventSubscriberInterface; | |
| /** |
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
| { | |
| "discussion" : { | |
| "comments" : { | |
| "comments" : [ | |
| { | |
| "id" : "0001", | |
| "downVotes" : 0, | |
| "upVotes" : 0, | |
| "message" : "Turkey meatloaf capicola tongue shankle. Shankle tongue pork chuck, rump leberkas tenderloin shoulder sirloin beef ribs pastrami salami corned beef.", | |
| "parentCommentId" : null, |
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
| git branch --merged | grep -v "\*" | xargs -n 1 git branch -d |
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 | |
| for($i=1;$i<=100;$i++){ | |
| $mod_3 = $mod_5 = false; | |
| if($i%3 == 0){ | |
| echo 'fizz<br>'; | |
| $mod_3 = true; | |
| } | |
| if($i%5 == 0){ | |
| echo 'buzz<br>'; |
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 | |
| public function view($techGuideid = null) { //details page for tech-guide | |
| // $params = array( | |
| // 'conditions' => array( | |
| // 'TechGuideline.id' => $techGuideid, | |
| // //'TechGuideline.is_active' => 1, | |
| // ), | |
| // 'fields' => array('User.first_name', 'User.last_name ', 'Technology.id', 'Technology.title', 'TechGuideline.id', 'TechGuideline.user_id', 'TechGuideline.title', 'TechGuideline.content', 'TechGuideline.created', 'TechGuideline.comments_count'), | |
| // 'joins' => array( |
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 TestsController extends AppController{ | |
| var $uses = array(); | |
| function promises_get(){ | |
| if(isset($this->params['named']['auth_token'])) $this->authToken = $this->params['named']['auth_token']; | |
| if(isset($this->params['named']['modified'])){ | |
| $this->__send('promises/get',array('modified' => $this->params['named']['modified'])); | |
| }elseif($this->params['named']['promise_request_id']){ | |
| $this->__send('promises/get',array('promise_request_id' => $this->params['named']['promise_request_id'])); |
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 Person extends AppModel{ | |
| public $hasMany = array('PromiseRequest','PromiseResponse'); | |
| public $hasOne = array('PersonInfo'); | |
| public function beforeSave(){ | |
| //check for accounts with the same info | |
| $found_person = null; | |
| if(isset($this->data['Person']['email'])){ |
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 | |
| define('DS',DIRECTORY_SEPARATOR); | |
| $base_path = $_SERVER['DOCUMENT_ROOT'].DS.'app'.DS.'webroot'.DS; | |
| $files = array( |
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 | |
| echo ($this->Paginator->sortKey() == 'LessonPlan.favorite_count') ? $this->Paginator->sortKey(): $this->Paginator->sort(__('Favorites',true),'favorite_count',array('direction' => 'desc')); | |
| echo ($this->Paginator->sortKey() == 'LessonPlan.created_at') ? $this->Paginator->sortKey() : $this->Paginator->sort(__('Date',true),'created_at',array('direction' => 'desc')); | |
| //both returns '0' |
NewerOlder