Skip to content

Instantly share code, notes, and snippets.

View cijagani's full-sized avatar
🏤
new office :)

chirag jagani cijagani

🏤
new office :)
View GitHub Profile
@cijagani
cijagani / gist:bf2be487a9eaa7227aee45cfeef4dcaa
Created February 4, 2018 07:24
sublime-3 remove unnecessary blank-lines and white spaces
A better way to find all empty lines (including ones with whitespace) would be: ^[\s]*?[\n\r]+
@cijagani
cijagani / ubuntu-configure-sendmail-with-gmail
Created April 23, 2018 02:27 — forked from sshtmc/ubuntu-configure-sendmail-with-gmail
Ubuntu sendmail using smtp.gmail.com
#!/bin/bash
HOST=$(hostname)
function install_postfix() {
echo | sudo debconf-set-selections <<__EOF
postfix postfix/root_address string
postfix postfix/rfc1035_violation boolean false
postfix postfix/mydomain_warning boolean
postfix postfix/mynetworks string 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
@cijagani
cijagani / Instructions.sh
Created April 24, 2018 05:06 — forked from GhazanfarMir/Instructions.sh
Install PHP7.2 NGINX and PHP7.2-FPM on Ubuntu 16.04
########## Install NGINX ##############
# Install software-properties-common package to give us add-apt-repository package
sudo apt-get install -y software-properties-common
# Install latest nginx version from community maintained ppa
sudo add-apt-repository ppa:nginx/stable
# Update packages after adding ppa
@cijagani
cijagani / .htaccess
Last active August 31, 2018 07:23
.htaccess with appropriate CORS header
<IfModule mod_rewrite.c>
Header add Access-Control-Allow-Origin: "*"
Header add Access-Control-Allow-Methods: "GET,POST,OPTIONS,DELETE,PUT"
Header add Access-Control-Allow-Headers: "Content-Type"
</IfModule>
@cijagani
cijagani / gulpfile.js
Last active December 26, 2019 03:18
minify css and js and compress images
let gulp = require('gulp');
let concat = require('gulp-concat');// file name concatination
let autoprefixer = require('gulp-autoprefixer');
let cleanCSS = require('gulp-clean-css'); //to clean css
let sourcemaps = require('gulp-sourcemaps');// for sourcemap
let minifyCSS = require('gulp-minify-css'); //minify css
let rename = require('gulp-rename'); //file rename
let sass = require('gulp-sass'); //sass to css
let del = require('del'); // to clean folders
@cijagani
cijagani / .htaccess
Created November 28, 2018 13:33
optimized htaccess file (testing done on codeigniter linux environment)
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond $1 !^(index\.php|resources|assets|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
# Without mod_rewrite, route 404's to the front controller
#ErrorDocument 404 /index.php
@cijagani
cijagani / Default.sublime-theme
Last active December 25, 2018 10:20
Increasing the Sidebar Font Size in Sublime Text
[
{
"class": "sidebar_label",
"color": [0,0,0],
"font.bold": false,
"font.size": 15,
"font.face": "open sans"
},
{
"class": "sidebar_label",
@cijagani
cijagani / ajax-form.js
Created April 4, 2019 13:44 — forked from havvg/ajax-form.js
jQuery AJAX form submit with Twitter Bootstrap modal
jQuery(function($) {
$('form[data-async]').live('submit', function(event) {
var $form = $(this);
var $target = $($form.attr('data-target'));
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize(),
Install PHP 7.1
sudo update-alternatives --set php /usr/bin/php7.0
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php7.1
php -v
PHP 7.1 Modules list (Example)
@cijagani
cijagani / .php_cs
Created March 29, 2020 10:52
php cs fixer file. (run this command on cmd : vendor/bin/php-cs-fixer -v fix . --path-mode=intersection -vvv) composer require friendsofphp/php-cs-fixer
<?php
$finder = Symfony\Component\Finder\Finder::create()
->notPath('vendor')
->notPath('system')
->notPath('application/config')
->notPath('application/hooks')
->notPath('application/libraries')
->notPath('application/cache')
->notPath('application/logs')
->notPath('application/views')