Skip to content

Instantly share code, notes, and snippets.

View takshaktiwari's full-sized avatar

Takshak Tiwari takshaktiwari

View GitHub Profile
@takshaktiwari
takshaktiwari / gitpull.sh
Last active July 28, 2022 12:23
Setup a Cron on server for specific interval like daily, and the script will check and pull the code from Github if there is any new release in repository. Change the variables according to your project and github account.
#! /bin/bash
USER="takshaktiwari"
PERSONAL_TOKEN="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"
AUTHOR="takshaktiwari"
PACKAGE="adash"
REMOTE_NAME="origin"
BRANCH="main"
@takshaktiwari
takshaktiwari / ExchangeRate.php
Created June 15, 2022 12:18
Currency / Exchange rates api
<?php
namespace App\APIs;
use Illuminate\Support\Facades\Http;
/**
* This API has predictable resource-oriented URLs, accepts form-encoded
* request bodies, returns JSON-encoded responses, and uses standard HTTP
* response codes, authentication, and verbs.
@takshaktiwari
takshaktiwari / vhosts-setup-with-lampp.md
Last active March 2, 2022 11:17
vHosts in LAMPP - Ubuntu

1. Allow the usage of custom virtual hosts

sudo gedit /opt/lampp/etc/httpd.conf

# Virtual hosts
#Include etc/extra/httpd-vhosts.conf

Uncomment above line to enable vhosts.

Virtual hosts

@takshaktiwari
takshaktiwari / DatabaseCreateCommand.php
Created March 2, 2022 06:58
Create database comand - Laravael
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
use PDO;
class DatabaseCreateCommand extends Command
{
@takshaktiwari
takshaktiwari / scrapper.php
Last active March 2, 2022 14:10
scrapper
#! /usr/bin/php
<?php
$shortopts = "";
$shortopts .= "u:";
$shortopts .= "d:";
$shortopts .= "o::";
$shortopts .= "r::";
$shortopts .= "s::";
$shortopts .= "h";
@takshaktiwari
takshaktiwari / vue-introduction.md
Last active February 28, 2022 05:37
Vue Intro / Features / Why to use

Why It’s Popular:


Put simply, it’s a view-oriented product. The view is the most essential part of everything that occurs inside the system, and all information is only validated if it interacts with views correctly. Creating just a single view is pretty basic, and here lies the main advantage and desire to use VueJS – the simplicity, and the low entry barrier. All you need to do is load the interface and add JavaScript to begin. Data is then sent to the view directly using simple syntax, where VueJS automatically renders the elements without coding – an instance of the system can then be used for the element’s rendering.

The tool allows for modification of parts of the code by keeping the information in the data object while the updates affect other linked parts in real time.

The Pros of Vue.js


# redirect to https
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# redirect to https (all traffic)
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]
@takshaktiwari
takshaktiwari / README.md
Last active March 3, 2022 15:11
Textlocal Sms Gateway

Sample Use Case

(new \App\Gateways\TextlocalSms)->message(
    'send_otp', 
    [
        'name'      => $user->name, 
        'otp'       => $otp, 
        'timeout'   =>  '15 Minutes'
    ]

)