Skip to content

Instantly share code, notes, and snippets.

View HamidOsouli-zz's full-sized avatar
🖥️
Always Learning

Hamid HamidOsouli-zz

🖥️
Always Learning
View GitHub Profile
@HamidOsouli-zz
HamidOsouli-zz / MultiTernary.js
Created November 10, 2018 21:55
this is the multi conditional with ternary operator for Javascript
let i = true;
let j = 14;
ans = i ? (j > 10 ? (j%7 === 7 ? 14 : 54 ) : 66) : 99;
// returns 14 because i === true && j > 10 && j%7 === 0
To bind a dependency to some class in laravel
$this->app->bind(‘App\Helpers\Stripe’, function($app){
$api_key = config(‘services.stripe.api_key’);
return new \App\Helpers\Stripe($api_key);
});