Skip to content

Instantly share code, notes, and snippets.

Robo deepak1556

Block or report user

Report or block deepak1556

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@deepak1556
deepak1556 / Js-->Lua
Created May 12, 2013
simple javascript methods such as pop(),splice(),indexOf(),instanceof(),extend(),apply() in lua
View Js-->Lua
function pop (arr)
local d = arr[table.getn(arr)]
table.remove(arr)
return d
end
function instanceof (obj1,obj2)
obj2 = tostring (obj2)
local mt = getmetatable (obj1)
@deepak1556
deepak1556 / jqueryUtil
Created Jun 15, 2013
some simple jquery functions
View jqueryUtil
$ = {
each : function(obj, callback) {
if ($.isArray(obj)) {
for(var i=0, j=obj.length; i<j ; i++) {
callback(i, obj[i]);
}
} else {
for(var k in obj) {
callback(k, obj[k]);
}
@deepak1556
deepak1556 / JSobj
Created Jun 15, 2013
some obj manipulation and validation functions
View JSobj
var objcopy = function(old) {
if (old === undefined) {
return undefined;
}
if (old === null) {
return null;
}
if (old.parentNode) {
return old;
@deepak1556
deepak1556 / arrayutils
Last active Dec 19, 2015
helper functions for manipulating arrays
View arrayutils
array.utils = (function() {
return {
arrayLoop: function(array, cb) {
for(var i = 0, j = array.length; i < j; i++) {
cb(array[i]);
}
},
arrayIndexof: function(array, item) {
@deepak1556
deepak1556 / webp2png.js
Created Dec 7, 2013
webp support using libwebpjs (webp->png in canvas)
View webp2png.js
WebPDecodeAndDraw = function (data) {
var decoder = new WebPDecoder();
var bitmap = decoder.WebPDecode(data, data.length);
if (bitmap) {
//Draw Image
var output = ctx.createImageData(canvas.width, canvas.height);
var biWidth = canvas.width;
var outputData = output.data;
@deepak1556
deepak1556 / README.md
Last active Jan 2, 2016
Setting up codecombat on windows
View README.md

services version on my 64bit system:

  • node v0.10.22
  • ruby v2.0.0.p533
  • mongodb v2.5.4

Requirements:

  • nodejs, rubyv2.0.0, mongodbv2.5.4

Steps :

@deepak1556
deepak1556 / index.js
Created Mar 22, 2014
requirebin sketch
View index.js
var parse = require('css-parse');
var css = '/* this is a comment */';
console.log(JSON.stringify(parse(css), null, 2));
@deepak1556
deepak1556 / rkt-volume
Last active Aug 29, 2015
Rocket Volume Spec
View rkt-volume
App1.aci:
```
{
"mountPoints": [
{
"name": "A",
"path": "/app1/a"
},
{
"name": "B",
@deepak1556
deepak1556 / fac.js
Last active Sep 30, 2016
Differnt styles of factorial implemetation in js for fun
View fac.js
/** Newbie Programmer */
function fac(n) {
if(n === 0)
return 1;
else
return n * fac(n-1);
}
/** Callback programmer */
function fact(n, cback) {
@deepak1556
deepak1556 / n.js
Created Dec 19, 2014
notimplemented
View n.js
var _slice = Array.prototype.slice;
function Maybe (fn) {
return function () {
return fn !== void 0 ? fn.apply(this, arguments) : 'Notimplemented'
}
}
function N (f) {
var name = f.name;
You can’t perform that action at this time.