- Hello World
fn main() { println!("Hello, world!"); }
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
cd ~ | |
curl -sS https://getcomposer.org/installer -o composer-setup.php | |
HASH=`curl -sS https://composer.github.io/installer.sig` | |
php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" | |
#check your installation directory where all executables are stored. eg /usr/bin | |
sudo php composer-setup.php --install-dir=/usr/bin --filename=composer | |
php -r "unlink('composer-setup.php');" |
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 | |
namespace App\Providers; | |
use Illuminate\Support\ServiceProvider; | |
class AppServiceProvider extends ServiceProvider | |
{ | |
/** | |
* Bootstrap any application services. |
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
server { | |
listen 80; | |
server_name app.rehanmanzoor.me; | |
charset utf-8; | |
client_max_body_size 1M; | |
location / { | |
proxy_pass http://127.0.0.1:8001; | |
proxy_http_version 1.1; |
title: Setting Up Laravel in Ubuntu / DigitalOcean keywords: servers, laravel, coderstape, coder's tape description: Let's take a look at settting up a server from scratch for Laravel. date: April 1, 2019 tags: servers, laravel permalink: setting-up-laravel-in-ubuntu-digitalocean img: https://coderstape.com/storage/uploads/GZTXUbyGum2xeUZM9qBD5aPv8EKLwG3C8RGcRon4.jpeg author: Victor Gonzalez authorlink: https://github.com/vicgonvt
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
/** | |
* Process datatables ajax request. | |
* | |
* @return \Illuminate\Http\JsonResponse | |
*/ | |
public function allData(Request $request) | |
{ | |
$registrations = Registration::with('product')->with('reg_type')->select('registrations.*'); | |
$datatable = Datatables::of($registrations); |
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 BlogController extends Controller | |
{ | |
/** | |
* Posts | |
* | |
* @return void | |
*/ | |
public function showPosts() |
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 IndianMoneyFormat($number, $decimal = 2) { | |
$explrestunits = "" ; | |
$decimal_text = "" ; | |
$number = explode('.', $number); | |
$num = $number[0]; | |
if(strlen($num)>3){ | |
$lastthree = substr($num, strlen($num)-3, strlen($num)); | |
$restunits = substr($num, 0, strlen($num)-3); // extracts the last three digits | |
$restunits = (strlen($restunits)%2 == 1)?"0".$restunits:$restunits; // explodes the remaining digits in 2's formats, adds a zero in the beginning to maintain the 2's grouping. | |
$expunit = str_split($restunits, 2); |