Skip to content

Instantly share code, notes, and snippets.

View oralunal's full-sized avatar

Oral ÜNAL oralunal

View GitHub Profile
@oralunal
oralunal / request-with-credentials.js
Created March 8, 2024 01:52 — forked from jfolds/request-with-credentials.js
API request with credentials via fetch/xhr/jquery
const apiBaseUrl 'https://localhost/some/api';
/** fetch */
window.fetch(`${apiBaseUrl}`, {
credentials: 'include'
})
.then(json)
.then((data) => {
console.log(data);
});
/** XHR */
@oralunal
oralunal / watchers.xml
Last active September 2, 2017 17:46 — forked from shibby/watchers.xml
<?xml version="1.0" encoding="UTF-8"?>
<TaskOptions>
<TaskOptions>
<option name="arguments" value="fix $FileDir$/$FileName$ --rules=@PSR2" />
<option name="checkSyntaxErrors" value="true" />
<option name="description" value="fix code style" />
<option name="exitCodeBehavior" value="NEVER" />
<option name="fileExtension" value="php" />
<option name="immediateSync" value="false" />
<option name="name" value="php-cs-fixer" />
@oralunal
oralunal / default.vcl
Created January 9, 2017 21:15 — forked from derekclee/default.vcl
Varnish Cache Set CORS headers
sub vcl_deliver {
if (req.url ~ "/fonts/") {
set resp.http.Access-Control-Allow-Origin = "*";
set resp.http.Access-Control-Allow-Methods = "GET, OPTIONS";
set resp.http.Access-Control-Allow-Headers = "Origin, Accept, Content-Type, X-Requested-With, X-CSRF-Token";
}
}