Skip to content

Instantly share code, notes, and snippets.

View ntung's full-sized avatar
🏠
Working from home

Tung Nguyen ntung

🏠
Working from home
View GitHub Profile
anonymous
anonymous / gist:3910584
Created October 18, 2012 09:08
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@olivierobert
olivierobert / CI Detect Ajax
Created November 22, 2012 09:26
Code Igniter // Detect and return AJAX / JSON response
/** Within the controller method **/
// If this is an ajax request, then return a JSON string
if ( $this->input->is_ajax_request() ):
$this->output->set_content_type('application/json');
$this->output->set_output( json_encode($data) );
endif;