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
function urlObject(options) | |
{ | |
default_options = {'url':window.location.href,'unescape':true,'convert_num':true}; | |
if(typeof options !== "object") | |
options = default_options; | |
else | |
{ | |
for(var index in default_options) | |
{ |
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
#!/bin/sh | |
rm composer.lock | |
exec 1>&2 |
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 | |
use App\Post; | |
class PostsController | |
{ | |
public function get() | |
{ | |
try { | |
//some code |
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 ResponseMacroServiceProvider extends ServiceProvider | |
{ | |
public function boot() | |
{ | |
Response::macro('success', function ($data) { | |
return Response::json([ | |
'errors' => false, | |
'data' => $data, |
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 PostsController | |
{ | |
public function get() | |
{ | |
try { | |
//some code | |
}catch (Exception $e){ | |
return response()->error($e->getMessage); |
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
export class APIService { | |
constructor(Restangular, ToastService) { | |
'ngInject'; | |
var headers = { | |
'Content-Type': 'application/json', | |
'Accept': 'application/x.laravel.v1+json' | |
}; | |
return Restangular.withConfig(function(RestangularConfigurer) { |
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
API.all('products').post({title, price}).then( (response) => { | |
var user = response.data.user; | |
}); |
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
API.all('products').post({title, price}).then( (response) => { | |
var user = response.data.user; | |
}, (response) => { | |
//response.status | |
//response.data | |
}); |
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
app.config(['$compileProvider', function ($compileProvider) { | |
$compileProvider.debugInfoEnabled(false); | |
}]); |
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
const fetchPolyfill = 'https://rawgit.com/github/fetch/master/fetch.js'; | |
promyfill('fetch' in window, fetchPolyfill).then(() => { | |
//fetch is available (polyfill is fetched only if needed) | |
fetch('users.json'); | |
}); |
OlderNewer