Skip to content

Instantly share code, notes, and snippets.

View revathskumar's full-sized avatar

Revath S Kumar revathskumar

View GitHub Profile

why ./task.js?

One word: task automation. It's basically zero effort and you can use the ./task.js package manager to handle any repetitive tasks. You can use ./task.js to automate everything with minimum effort.

./task.js provides the structure, order, and authority that you as a developer so desperately crave. ./task.js will also take responsibility for your actions if you need it to. It's what everybody is using now. ./task.js is the new hotness. It's all about ./task.js now, just like that.

This is compared to npm run/bash scripts, which are:

-- Control frame information -----------------------------------------------
c:0006 p:---- s:0017 e:000016 CFUNC :send_objectspace_dump
c:0005 p:0149 s:0014 e:000013 METHOD /Users/revathskumar/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rbkit/server.rb:71
c:0004 p:0051 s:0010 e:000009 BLOCK /Users/revathskumar/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rbkit/server.rb:46 [FINISH]
c:0003 p:---- s:0007 e:000006 CFUNC :loop
c:0002 p:0009 s:0004 e:000003 BLOCK /Users/revathskumar/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rbkit/server.rb:42 [FINISH]
c:0001 p:---- s:0002 e:000001 (none) [FINISH]
-- Ruby level backtrace information ----------------------------------------
/Users/revathskumar/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rbkit/server.rb:42:in `block in start'
-- The C compiler identification is AppleClang 6.1.0.6020053
-- The CXX compiler identification is AppleClang 6.1.0.6020053
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works
# Makefile.in generated by automake 1.11.3 from Makefile.am.
# Makefile. Generated from Makefile.in by configure.
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
# Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@revathskumar
revathskumar / bind.js
Last active December 23, 2015 23:29
extend/Inheritance and bind method created by CS
__bind = function(fn, me){
return function(){
return fn.apply(me, arguments);
};
}

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
var Parent = function Parent(){
};
Parent.prototype = {
a:function a(){
console.log(333);
}
};
@revathskumar
revathskumar / debussy13_2.js
Created August 22, 2013 05:27
Google doodle 2013-08-22
(function () {
var h, k = this,
ba = function (a) {
var b = typeof a;
if ("object" == b)
if (a) {
if (a instanceof Array) return "array";
if (a instanceof Object) return b;
var c = Object.prototype.toString.call(a);
if ("[object Window]" == c) return "object";
@revathskumar
revathskumar / a.php
Last active December 20, 2015 15:59
PHP : Add element in the beginning of an array
<?php
$a = array(
1 => "First",
2 => "Second",
5 => "Fifth"
);
?>
.notepad {
background: #f6f6f6;
box-shadow: 0 1px 4px rgba(0,0,0,0.25);
position: relative;
background-image: -webkit-radial-gradient(#e6e6e6 21%, transparent 21%),-webkit-radial-gradient(rgba(0,0,0,0.25) 21%, transparent 26%),-webkit-linear-gradient(top, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 95%, rgba(96,159,159,0.1) 95%, rgba(96,159,159,0.1) 100%);
background-image: -moz-radial-gradient(#e6e6e6 21%, transparent 21%),-moz-radial-gradient(#e6e6e6 10%, transparent 12%),-moz-linear-gradient(top, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 95%, rgba(96,159,159,0.1) 95%, rgba(96,159,159,0.1) 100%);
background-image: radial-gradient(#e6e6e6 21%, transparent 21%),radial-gradient(#e6e6e6 10%, transparent 12%),linear-gradient(top, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 95%, rgba(96,159,159,0.1) 95%, rgba(96,159,159,0.1) 100%);
background-position: 6px 6px,6px 5px,50% 18px;
background-repeat: repeat-y,repeat-y,repeat;
background-size: 48px 48px,48px 48px,24px 24px;