Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Praneeth Nidarshan pranid

🎯
Focusing
Block or report user

Report or block pranid

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@pranid
pranid / compress.php
Last active Nov 20, 2017
Bulk Images Compressor for Servers
View compress.php
<?php
function getFolderFiles($dir){
$quality = 60;
$scan_dir = scandir($dir);
echo '<ol>';
foreach($scan_dir as $file_path){
$destination = $dir."\/".$file_path;
@pranid
pranid / .htaccess
Created Dec 31, 2016
Prestashop .htaccess file for localhost :: please replace text 'yourproject' with your folder name
View .htaccess
# ~~start~~ Do not remove this comment, prestashop will keep automatically the code outside this comment when .htaccess will be generated again
# .htaccess automaticaly generated by prestashop e-commerce open-source solution
# http://www.prestashop.com - http://www.prestashop.com/forums
<IfModule mod_rewrite.c>
<IfModule mod_env.c>
SetEnv HTTP_MOD_REWRITE On
</IfModule>
RewriteEngine on
@pranid
pranid / getDates.js
Last active Oct 27, 2016
Get dates between two dates
View getDates.js
/**
* Created by Praneeth Nddarshan on 10/25/2016.
*/
var from_date = '2016-01-01';
var to_date = '2016-02-20';
var dates = getDates(from_date, to_date);
@pranid
pranid / php_getcontent.php
Last active Aug 25, 2016
Get API related form data JSON
View php_getcontent.php
<?php
// use this to capture data that not from GET OR POST
// refer http://stackoverflow.com/questions/19004783/reading-json-post-using-php
$json = file_get_contents('php://input');
$obj = json_decode($json);
?>
@pranid
pranid / nginx-prestashop-server-config
Created Aug 16, 2016
Nginx Server Configuration file for Prestashop
View nginx-prestashop-server-config
server {
listen 80; ## listen for ipv4; this line is default and implied
listen [::]:80; ## listen for ipv6
# Replace/ set your directory path here
root /var/www/html/prestashop;
index index.html index.htm index.php;
# Make site accessible from http://localhost/
@pranid
pranid / Amortization.php
Last active Oct 25, 2019
Amortization Schedule Example -- PHP Version
View Amortization.php
<?php
/**
* AMORTIZATION CALCULATOR
* @author PRANEETH NIDARSHAN
* @version V1.0
*/
class Amortization
{
private $loan_amount;
private $term_years;
@pranid
pranid / AmortizationSchedule.js
Last active Aug 27, 2016
Amortization Schedule Example JavaScript
View AmortizationSchedule.js
/**
* Created by praneeth on 8/27/2016.
*/
var capital = 100000;
var period = 12;
var rate = 12;
var r = parseFloat(rate) / (100 * period) ;
// console.log(r);
View moment-clock.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="description" content="Moment JS clock for beginners.">
<meta name="keywords" content="HTML,CSS,MOMENT, JAVASCRIPT, JQUERY, CLOCK, TIME">
<meta name="author" content="Praneeth Nidarshan">
<title>MOMENT CLOCK</title>
<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
@pranid
pranid / smtpMail.php
Last active Sep 16, 2015
Send email using gmail smtp - Codeigniter
View smtpMail.php
<?php defined('BASEPATH') OR exit('No direct script access allowed');
class SMTPMail extends CI_Controller {
/**
* @author Praneeth Nidarshan
* @see git@gist.github.com:8d54499e903d35155af6.git
*/
public function index()
{
@pranid
pranid / compare-images.php
Last active Jul 1, 2019 — forked from akosnikhazy/compare-images-class
Compare two images with PHP
View compare-images.php
<?php
class compareImages
{
private function mimeType($i)
{
/*returns array with mime type and if its jpg or png. Returns false if it isn't jpg or png*/
$mime = getimagesize($i);
$return = array($mime[0],$mime[1]);
switch ($mime['mime'])
You can’t perform that action at this time.