Skip to content

Instantly share code, notes, and snippets.

View akshar100's full-sized avatar

Akshar Prabhu Desai akshar100

View GitHub Profile
@akshar100
akshar100 / Graph Generation
Created October 7, 2011 12:33
Generates a Graph for my MTP stage 1
function drawVisualization() {
// Create and populate the data table.
var data = new google.visualization.DataTable();
var raw_data = [['Latency',200093,200602,201115,201686,202209,202712,203231,203741,204260,204811,205312,205830,206339,206842,207356,207857,208371,208886,209403]];
var years = [];
for(var i = 1; i <raw_data[0].length;i++)
{
years.push(i);
}
@akshar100
akshar100 / Android.mk
Created March 24, 2012 19:41
To add your own modules to the kernel of the Android-x86 project. Replace the Android.mk file in the kernel folder with this file.
#
# Copyright (C) 2009-2011 The Android-x86 Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@akshar100
akshar100 / pygame_joystick.py
Created April 11, 2012 10:15
Pygame Joystick control
# Author: Akshar Prabhu Desai
# Date: 20/04/2011
# Objective: To interface FB5 with joystick
#
import pygame
import inspect
import math
import time
exec(open("functionList.py").read());
@akshar100
akshar100 / firebird_joystick.py
Created April 11, 2012 10:17
Firebird control via joystick
# Author: Akshar Prabhu Desai
# Date: 20/04/2011
# Objective: To interface FB5 with joystick
#
import pygame
import inspect
import math
import time
exec(open("functionList.py").read());
@akshar100
akshar100 / xbee_python.py
Created April 11, 2012 10:17
Xbee and Python
def init(port):
import zigbee;
zigbee.init(port);
def forward():
import zigbee;
zigbee.sendString("a");
def stop():
import zigbee;
zigbee.sendString(" ");
def backward():
var PostModel = Y.Base.create('postModel', Y.Model, [], {
sync: modelSync,
idAttribute: '_id',
profilePic: function () {
return baseURL + 'in/profile_pic/' + this.get('author_id');
},
initializer: function (config) {
@akshar100
akshar100 / genericModel
Created July 22, 2012 12:41
GenericModel
var GenericModel = Y.Base.create('GenericModel', Y.Model, [], {
sync: genericModelSync
,idAttribute:'_id'
});
@akshar100
akshar100 / gist:3786844
Created September 26, 2012 08:45
States in India Python
('Andhra Pradesh','Andhra Pradesh'),
('Arunachal Pradesh','Arunachal Pradesh'),
('Assam','Assam'),
('Bihar','Bihar'),
('Chhattisgarh','Chhattisgarh'),
('Delhi','Delhi'),
('Goa','Goa'),
('Gujarat','Gujarat'),
('Haryana','Haryana'),
('Himachal Pradesh','Himachal Pradesh'),
@akshar100
akshar100 / gist:3789842
Created September 26, 2012 18:56
Y.CommonModel
/**
* Validations Facade. All the validation rules go here.
*/
Y.ValidationFacade = Y.Base.create("ValidationFacade", Y.Base, [], {
validations: {
trim: function(key, val, attrs) {
if (!val) {
val = "";
}
@akshar100
akshar100 / gist:3913836
Created October 18, 2012 18:09
youtube matcher
/https?:\/\/(?:[a-zA_Z]{2,3}.)?(?:youtube\.com\/watch\?)((?:[\w\d\-\_\=]+&amp;(?:amp;)?)*v(?:&lt;[A-Z]+&gt;)?=([0-9a-zA-Z\-\_]+))/i