This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rem Close all cmd.exe | |
taskkill /F /IM cmd.exe /T | |
rem Delete temporary folder that contain "scope" in its name | |
FOR /D /R %dir% %%X IN (scope*) DO RMDIR /S /Q "%%X" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Lets say , we want to send a direction request with guidance to Google Maps API using link below. | |
// https://maps.googleapis.com/maps/api/directions/json?origin=-6.190109,%20106.798565&destination=-6.177596,%20106.792611&key=USEYOUR_KEY | |
// some of request, especially in field html-instruction would return unicode html text like this one ('Head \u003cb\u003ewest\u003c/b\u003e'). | |
// for some reason, I just want to use the text provided there ('Head west'). | |
// after some googling and asking, here is the best code I have (right now) | |
# example response | |
//Type A : There are 2 sentence in one single direction response |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
defined('BASEPATH') OR exit('No direct script access allowed'); | |
class BCAAPI extends MY_Controller { | |
function __construct(){ | |
$this->api_key = "YOUR API KEY"; | |
$this->api_secret = "YOUR API SECRET"; | |
$this->client_id = "YOUR CLIENT ID"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// this script would save csv file to this specified directory | |
// APPPATH is location of application folder in Codeigniter | |
$file = fopen(APPPATH . '/../upload/'.'tesaasasat.csv', 'wb'); | |
// set the column headers | |
fputcsv($file, array('Column 1', 'Column 2', 'Column 3', 'Column 4', 'Column 5')); | |
// Sample data. This can be fetched from mysql too | |
$data = array( |
NewerOlder