Skip to content

Instantly share code, notes, and snippets.

View thatal's full-sized avatar
🏳️
Working

Sunil Thatal thatal

🏳️
Working
View GitHub Profile
@thatal
thatal / rust-cheat-sheet.md
Created June 10, 2024 03:49
Cheat sheet for rust language

Rust Cheat Sheet

1. Basic Syntax

  • Hello World
    fn main() {
        println!("Hello, world!");
    }
@thatal
thatal / host-react-app-on-apache-server.md
Created October 7, 2021 05:18 — forked from ywwwtseng/host-react-app-on-apache-server.md
Host react application on Apache server

Host react application on Apache server

Step 1 : Create your app

$ npm install -g create-react-app 
$ create-react-app my-app

Step 2 : Build it for production

@thatal
thatal / install.bash
Last active May 24, 2021 18:55
new version of Composer installation on linux machine
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');"
@thatal
thatal / AppServiceProvider.php
Created May 18, 2021 09:46
Expose redirected to local site error fixing
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
@thatal
thatal / nginx.conf
Created May 14, 2021 08:56 — forked from rummykhan/nginx.conf
Nginx + Supervisor conf for Octane
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;
@thatal
thatal / lamp_install.md
Created April 8, 2021 08:47 — forked from ondrejh/lamp_install.md
LAMP installation

Install Apache

sudo apt update
sudo apt install apache2

Install MySQL

@thatal
thatal / deployment_guide.md
Created August 2, 2020 08:27 — forked from vicgonvt/deployment_guide.md
Deployment Guide for Ubuntu Server from Scratch with Laravel
@thatal
thatal / RegistrationController.php
Created July 31, 2020 16:44 — forked from oranges13/RegistrationController.php
Populate external drop downs for datatable filtering
/**
* 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);
@thatal
thatal / BlogController.php
Created July 15, 2020 18:03 — forked from tobysteward/BlogController.php
Laravel AJAX Pagination with JQuery
<?php
class BlogController extends Controller
{
/**
* Posts
*
* @return void
*/
public function showPosts()
@thatal
thatal / numbertoins.php
Last active November 15, 2018 07:54
Number to Indian Numbering system.
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);