Skip to content

Instantly share code, notes, and snippets.

View maldechavda's full-sized avatar
😀

Malde Chavda maldechavda

😀
View GitHub Profile
<?php
/**
* print_r with <pre>.
*/
function pre()
{
$args = func_get_args();
foreach ($args as $arg) {
@maldechavda
maldechavda / .profile
Created November 3, 2016 07:20
add spark installer in $PATH ubantu
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
SET GLOBAL sql_mode = '';
@maldechavda
maldechavda / index.html
Last active November 14, 2016 09:19
Copy TO Clipboard
<input id="txt" />
<button id="btn">Copy To Clipboard</button>
@maldechavda
maldechavda / README.md
Created March 24, 2017 09:41 — forked from oodavid/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@maldechavda
maldechavda / ForceHttps.php
Created July 6, 2017 11:29
Laravel force redirect to https using Middleware
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\RedirectResponse;
class ForceHttps
{
/**
@maldechavda
maldechavda / php7.2.sh
Created December 2, 2017 09:29
Install php7.2 over php7.1 in laravel server
#!/bin/bash
sudo apt-get install -y php7.2 php7.2-cli php7.2-dev \
php7.2-pgsql php7.2-sqlite3 php7.2-gd \
php7.2-curl php7.2-memcached \
php7.2-imap php7.2-mysql php7.2-mbstring \
php7.2-xml php7.2-zip php7.2-bcmath php7.2-soap \
php7.2-intl php7.2-readline
@maldechavda
maldechavda / AddAvatarTest.php
Created February 19, 2018 12:30
Laravel File Upload test
<?php
namespace Tests\Feature;
use Tests\TestCase;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\Storage;
use Illuminate\Foundation\Testing\RefreshDatabase;
class AddAvatarTest extends TestCase
@maldechavda
maldechavda / multiple_ssh_setting.md
Created March 27, 2018 10:10 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@maldechavda
maldechavda / Cors.php
Created July 14, 2018 06:58 — forked from drewjoh/Cors.php
Laravel CORS Middleware
<?php // /app/Http/Middleware/Cors.php
namespace App\Http\Middleware;
use Closure;
class Cors {
public function handle($request, Closure $next)
{
return $next($request)