Skip to content

Instantly share code, notes, and snippets.

antoniodipinto antoniodipinto

Block or report user

Report or block antoniodipinto

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
@antoniodipinto
antoniodipinto / Input_Json.php
Created Jul 6, 2019
A simple class fo CodeIgniter that helps to receive JSON format data
View Input_Json.php
<?php
/**
* Author: Antonio Di Pinto
* Email: adp19911229@gmail.com
*
* @description: A simple class fo CodeIgniter that helps to receive JSON format data
*/
class Input_Json extends CI_Input
{
@antoniodipinto
antoniodipinto / index.php
Created Aug 30, 2016
Routing main page PHP
View index.php
<?php
// Importo le classi del framework
use \Psr\Http\Message\ServerRequestInterface as Request;
use \Psr\Http\Message\ResponseInterface as Response;
// Richiamo il loader del framework
require 'vendor/autoload.php';
// Creo una nuova istanza della classe App
@antoniodipinto
antoniodipinto / distance_by_google.sql
Created Aug 30, 2016
This query will return the distance between two points
View distance_by_google.sql
#This query will return the distance between two points
SELECT id, ( 3959 * acos( cos( radians(37) ) * cos( radians( lat ) ) * cos( radians( lng ) - radians(-122) ) + sin( radians(37) ) * sin( radians( lat ) ) ) )
AS distance
FROM markers
HAVING distance < 25
ORDER BY distance LIMIT 0 , 20;
@antoniodipinto
antoniodipinto / distance.sql
Created Aug 30, 2016
This query return the distance between two cordinates
View distance.sql
#This query return the distance between two cordinates
SELECT *,
(((acos(sin((LATITUDE_VALUE*pi()/180)) * sin(('nome_colonna_latitudine'*pi()/180))+cos((LATITUDE_VALUE*pi()/180)) * cos(('nome_colonna_latitudine'*pi()/180)) * cos(((LONGITUDE_VALUE- 'nome_colonna_longitudine'e)*pi()/180))))*180/pi())*60*1.1515*1.609344)
as distance
FROM coordinates_table
ORDER BY distance ASC;
You can’t perform that action at this time.