Skip to content

Instantly share code, notes, and snippets.

View braicauc's full-sized avatar

Braicau Constantin Catalin braicauc

View GitHub Profile
@braicauc
braicauc / geolocation.js
Last active October 24, 2016 11:13
Geolocation script ... does not work in chrome without SSL
function showPosition(position) {
document.write('Latitude: '+position.coords.latitude+'Longitude: '+position.coords.longitude);
}
function showError(error) {
switch(error.code) {
case error.PERMISSION_DENIED:
alert("User denied the request for Geolocation.");
break;
.text-xs-left { text-align: left; }
.text-xs-right { text-align: right; }
.text-xs-center { text-align: center; }
.text-xs-justify { text-align: justify; }
@media (min-width: @screen-sm-min) {
.text-sm-left { text-align: left; }
.text-sm-right { text-align: right; }
.text-sm-center { text-align: center; }
.text-sm-justify { text-align: justify; }
@braicauc
braicauc / get_center_latitude_longitude
Created September 6, 2016 09:05
Get a center latitude,longitude from an array of like geopoints
/**
* Get a center latitude,longitude from an array of like geopoints
*
* @param array data 2 dimensional array of latitudes and longitudes
* For Example:
* $data = array
* (
* 0 = > array(45.849382, 76.322333),
* 1 = > array(45.843543, 75.324143),
* 2 = > array(45.765744, 76.543223),
@braicauc
braicauc / upload
Created August 19, 2016 06:00
Upload CSV file into MySQL table
use your command line tool to log into mysql with:
mysql -u root -p -h localhost
then ...
LOAD DATA LOCAL INFILE '/path/to/file.csv'
INTO TABLE databasename.yourtable
FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n'
IGNORE 1 LINES