Skip to content

Instantly share code, notes, and snippets.

View vinothbabu's full-sized avatar
🤘

Thalaivar vinothbabu

🤘
  • Chennai, TamilNadu
View GitHub Profile
@vinothbabu
vinothbabu / HTTPClient
Last active October 10, 2015 01:27
Generic HTTPClient or Ajax Class which only creates a single instance.
var JSONCall = function(url,data, onLoad, onError){
this.url = url;
this.data = data;
this.onLoad = onLoad;
this.onError = onError;
};
JSONCall.prototype = {
call: function(){
if(typeof JsonClient==='undefined'){
JsonClient = Titanium.Network.createHTTPClient();
@vinothbabu
vinothbabu / Puzzle
Created September 3, 2012 16:06
Puzzle Game - Titanium and JavaScript
<!doctype html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>15 Puzzle</title>
<style type="text/css">
body{color:black;background:white;font-family:Arial,Helvetica,sans-serif;font-size:20px;margin:0;}
table tr td{text-align:center;}
@vinothbabu
vinothbabu / Sorting JSON response based on type
Created August 10, 2012 13:49
Sorting JSON response based on type
<script type="text/javascript">
onerror = function (a, b, c) {
alert([a, b, c]);
};
</script>
<script type="text/javascript">
var x = {
"JsonResult": {
"List": [{
"Subject": "My book report on J. K. Rowling's <u>Harry Potter</u> series.",
@vinothbabu
vinothbabu / searchable and sortable data structure - Plugin NodeJS
Created August 10, 2012 13:37
searchable and sortable data structure - Using NodeJS
//sortable-2d-array.js
exports = module.exports = sortable2DArray;
function sortable2DArray(data) {
this.data = data;
}
sortable2DArray.prototype.sortBy = function (o) {
var fields = o.fields || [];