Skip to content

Instantly share code, notes, and snippets.

View pranid's full-sized avatar
🎯
Focusing

Praneeth Nidarshan pranid

🎯
Focusing
View GitHub Profile
@rintoug
rintoug / magento.php
Created March 27, 2017 18:00
Magento: Convert Price from Current Currency to Base Currency
<?php
$baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();
$currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();
$price = 200;
// convert price from base currency to current currency
$priceTwo = Mage::helper('directory')->currencyConvert($price, $baseCurrencyCode, $currentCurrencyCode);
@pranid
pranid / getDates.js
Last active October 27, 2016 07:11
Get dates between two dates
/**
* 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);
<!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 / compare-images.php
Last active January 24, 2023 07:01 — forked from akosnikhazy/compare-images-class
Compare two images with 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'])
@nicktoumpelis
nicktoumpelis / repo-rinse.sh
Created April 23, 2014 13:00
Cleans and resets a git repo and its submodules
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
@samir
samir / gist:734321
Created December 9, 2010 04:04
Distance between two coordinates (latitude/longitude) in PHP
function distance($lat1 = 0, $lng1 = 0, $lat2 = 0, $lng2 = 0, $miles = true)
{
$pi80 = M_PI / 180;
$lat1 *= $pi80;
$lng1 *= $pi80;
$lat2 *= $pi80;
$lng2 *= $pi80;
$r = 6372.797; // mean radius of Earth in km
$dlat = $lat2 - $lat1;