Skip to content

Instantly share code, notes, and snippets.

View sibysathyanesan's full-sized avatar

Siby Sathyanesan sibysathyanesan

View GitHub Profile
@sibysathyanesan
sibysathyanesan / installation_laravel
Last active June 7, 2019 11:29
laravel installation
create-project laravel/laravel <Projectname>
Create virtual hosts in ubuntu.
add site specific entries to following two file locations
1) sudo subl /etc/apache2/sites-available/000-default.conf
DocumentRoot /var/www/html/Projectname/public
3) sudo subl /etc/hosts
@sibysathyanesan
sibysathyanesan / category dropdown
Created June 7, 2019 11:32
wordpress category dropdown
<div class="class-drop">
<select name="batch_sel" >
<option value="all" <?php if($_GET['batch_sel'] == 'all'){echo 'selected'; } ?> >All </option>
<?php
$terms = get_terms( array(
'taxonomy' => 'result-year',
'hide_empty' => false, ) );
$batch_slugs = wp_list_pluck( $terms, 'slug' );
foreach($terms as $term):
?>
@sibysathyanesan
sibysathyanesan / xampp-virtualhost.md
Created June 10, 2019 11:09 — forked from ibrahimtuzlak0295/xampp-virtualhost.md
Create virtual host in XAMPP, Ubuntu 16.04

I’ll go step-by-step on how to create a virtual host in the XAMPP environment. As we know, the default http://localhost points to /opt/lampp/htdocs as the root directory. The desired result is to be able to visit http://examplevhost.local, with the root directory being /opt/lampp/htdocs/examplevhost.

Note: The steps below are done on Ubuntu 16.04, but they should also work on most other Linux distribution

Note: I’ll assume that XAMPP is installed in /opt/lampp. If it’s different on your setup, please read carefully adjust accordingly

Enable virtual hosts in apache configuration file

Note: This should be done only once per XAMPP installation. If you want to add another virtual host later you can skip to the next step

1.) Update the vhosts file in Apache configuration. Under your XAMPP folder
apache\conf\extra\httpd-vhosts.conf and if needed change the ports (i.e. if you use 8080 instead of port 80)
ex: <VirtualHost *:80>
DocumentRoot “[my site file’s path]”
ServerName [your favourable server name]
<Directory “[my site file’s path]”>
Require all granted
</Directory>
</VirtualHost>
@sibysathyanesan
sibysathyanesan / Where Featured Images Are Stored
Created July 9, 2019 09:59
WP featured image in Database
windows - xampp/php/php.ini
ubuntu - /etc/php/7.2/apache2/php.ini
max_execution_time = 5000
max_input_time = 5000
memory_limit = 1000M
post_max_size = 750M
upload_max_filesize = 750M
@sibysathyanesan
sibysathyanesan / SMTP_PHP
Created December 12, 2019 05:53
Mail using SMTP php
function mail_test() {
// gamil smtp config
/* $config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => '[email protected]',
'smtp_pass' => 'hotmttknhlcudrtr',
'charset' => 'utf-8',
@sibysathyanesan
sibysathyanesan / Mysql Timestamp
Last active January 30, 2020 09:43
created_at, updated_at Column in Your MySQL Table
CREATE TABLE orders(
id INT NOT NULL AUTO_INCREMENT,
user_id INT NULL,
amount FLOAT NULL,
updated_at TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE NOW(),
created_at TIMESTAMP NOT NULL,
PRIMARY KEY(id)
);
To find the linux release
lsb_release -a
list installed packages
apt list --installed
Check service current status
sudo service <serviceName> status
git checkout <branch name>
git merge master
**resolve conflicts**
git checkout master
git merge --no-ff <branch name>