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 / gpg_git_signing.md
Created September 22, 2022 05:11 — forked from alopresto/gpg_git_signing.md
Steps to enable GPG signing of git commits.

If anyone is interested in setting up their system to automatically (or manually) sign their git commits with their GPG key, here are the steps:

  1. Generate and add your key to GitHub
  2. $ git config --global commit.gpgsign true ([OPTIONAL] every commit will now be signed)
  3. $ git config --global user.signingkey ABCDEF01 (where ABCDEF01 is the fingerprint of the key to use)
  4. $ git config --global alias.logs "log --show-signature" (now available as $ git logs)
  5. $ git config --global alias.cis "commit -S" (optional if global signing is false)
  6. $ echo "Some content" >> example.txt
  7. $ git add example.txt
  8. $ git cis -m "This commit is signed by a GPG key." (regular commit will work if global signing is enabled)
@cijagani
cijagani / .gitconfig
Created August 16, 2020 12:47 — forked from sarthaksavvy/.gitconfig
Git configuration
[alias]
acm = "!f() { git add . && git commit -m \"$(echo $@)\"; }; f";
com = checkout master
cob = checkout -b
b = branch
p = push
pl = pull
s = status
@cijagani
cijagani / .phpcsfixer
Created August 16, 2020 12:46 — forked from sarthaksavvy/.phpcsfixer
PHP CS Fixer
<?php
return PhpCsFixer\Config::create()
->setRules(array(
'@PSR2' => true,
'array_indentation' => true,
'array_syntax' => array('syntax' => 'short'),
'combine_consecutive_unsets' => true,
'method_separation' => true,
'no_multiline_whitespace_before_semicolons' => true,
@cijagani
cijagani / Zsh
Created August 16, 2020 12:46 — forked from sarthaksavvy/Zsh
Terminal Alias
export DEFAULT_USER="$(whoami)"
export PATH=~/.composer/vendor/bin:$PATH
# Alias for composer
alias cr=composer
alias cri="composer install"
alias crd="composer dump-autoload"
alias cru="composer update"
# Alias for artisan commands
@cijagani
cijagani / deploy.php
Last active January 15, 2021 13:19 — forked from riodw/deploy.php
Deploy to Production Server with git using PHP
<?php
function isEnabled($func) {
return is_callable($func) && false === stripos(ini_get('disable_functions'), $func);
}
if (!isEnabled('shell_exec')) {
echo "shell_exec is disabled";
exit();
}
/**
* GIT DEPLOYMENT SCRIPT
@cijagani
cijagani / HostNameRouter.php
Created July 2, 2020 11:22 — forked from chill117/HostNameRouter.php
Manage multiple hostnames (domains, sub-domains) within a single instance of CodeIgniter.
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/*
Manage multiple hostnames (domains, sub-domains) within a single instance of CodeIgniter.
Example:
If you had the following domain/sub-domain style for your site:
your-domain.com
@cijagani
cijagani / App_log.php
Created June 11, 2020 15:20
track : 404 Page Not Found: /index
<?php
/** filename: App_log.php
* put this file in Codeigniter Core folder
*/
class App_Log extends CI_Log
{
function __construct()
{
parent::__construct();
@cijagani
cijagani / .php
Created May 24, 2020 09:50
remove all comments in php code using sublime
find use following pattern with regular expression or (Alt +r)
(^\/\/.*)|(\s+\/\/.*)|((\/\*)(.|\n)+?(\*\/))
@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')
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)