Skip to content

Instantly share code, notes, and snippets.

View vinothbabu's full-sized avatar
🤘

Thalaivar vinothbabu

🤘
  • Chennai, TamilNadu
View GitHub Profile
This file has been truncated, but you can view the full file.
/**
* @license AngularJS v1.2.20
* (c) 2010-2014 Google, Inc. http://angularjs.org
* License: MIT
*/
(function(window, document, undefined) {'use strict';
/**
* @description
*
angular.element(document.querySelector('[ng-app]').injector()
.invoke(function($rootScope){
var per = performance.now();
$rootScope.$apply();
console.log(performance.now() - per);
})
});
@vinothbabu
vinothbabu / dojo editor
Created March 22, 2015 22:18
Dojo Editior template
<!DOCTYPE html>
<html>
<head>
<link href="//ajax.googleapis.com/ajax/libs/dojo/1.10.1/dijit/themes/claro/claro.css" rel="stylesheet" type="text/css" />
<script src="//ajax.googleapis.com/ajax/libs/dojo/1.10.1/dojo/dojo.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body class="claro" style="height:500px; width: 100%">
@vinothbabu
vinothbabu / circular-references.php
Created November 1, 2013 00:35
circular references
<?php
class Vinoth {
public $f;
}
class Kevin {
public $f;
}
@vinothbabu
vinothbabu / CreditCardValidator.js
Last active December 17, 2015 00:39
Luhn algorithm - JavaScript implementation
function CreditCardValidator() {
}
CreditCardValidator.prototype = {
isValid: function (identifier) {
var num,
sum = 0,
alt;
var myRegxp = /^([0-9]){13,19}$/;
@vinothbabu
vinothbabu / BinarySearchTree.js
Last active December 17, 2015 00:11
BinarySearchTree
function BinarySearchTree() {
this._root = null;
}
BinarySearchTree.prototype = {
constructor: BinarySearchTree,
add: function (value) {
@vinothbabu
vinothbabu / MeemoryClean.js
Created October 16, 2012 09:38
Memory Cleaning for Application developed using Appcelerator Titanium
var MemoryClean = function() {
var _window;
/*
Here we make our "auto-release" pool. It's simply a window.
We hide it upon creation so it won't interfere with our view hierarchy.
5/3/2011: It seems that the window does not need to be a subcontext, just a regular window will do.
*/
this.init = function() {
//_window = Ti.UI.createWindow();
@vinothbabu
vinothbabu / gist:3691041
Created September 10, 2012 13:50
Capture picture and Scribbling using Titanium
function capturePictureDialog(opts)
{
var dialogCallback=(typeof opts.callback=="undefined")?new Function(""):opts.callback;
var scribblingEnabled=(typeof opts.scribbling=="undefined")?false:opts.scribbling;
if(scribblingEnabled)
{
Titanium.Paint = require('ti.paint');
Ti.Paint = Titanium.Paint;
@vinothbabu
vinothbabu / gist:3666340
Created September 7, 2012 13:40
Capture picture using Titanium
function capturePictureDialog(opts) {
var dialogCallback = (typeof opts.callback == "undefined") ? new Function("") : opts.callback;
function cropImageBlob(image, cropRect) {
var h = image.height;
var w = image.width;
var toH = cropRect.height;
if (toH > h) {
toH = h;
@vinothbabu
vinothbabu / gist:3610375
Created September 3, 2012 16:11
call a private function from a string in javascript
var valdiate = (function() {
var _p={};//toss all private members into a single object.
_p.list=[];
_p.init=function(){
_p.list=[];
};
var noDigits = function() {