Skip to content

Instantly share code, notes, and snippets.

View yashuarc's full-sized avatar

Yashwanth B M yashuarc

View GitHub Profile
@yashuarc
yashuarc / 0_reuse_code.js
Last active August 29, 2015 14:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@yashuarc
yashuarc / enable_cors_on_cakephp.php
Last active November 7, 2023 15:43
Enabling CORS on CakePHP
public function beforeFilter() {
parent::beforeFilter();
$this->response->header('Access-Control-Allow-Origin','*');
$this->response->header('Access-Control-Allow-Methods','*');
$this->response->header('Access-Control-Allow-Headers','X-Requested-With');
$this->response->header('Access-Control-Allow-Headers','Content-Type, x-xsrf-token');
$this->response->header('Access-Control-Max-Age','172800');
}