Skip to content

Instantly share code, notes, and snippets.

View abhisheksliam's full-sized avatar

Abhishek Kumar abhisheksliam

View GitHub Profile
@abhisheksliam
abhisheksliam / install.md
Created October 1, 2020 17:30 — forked from Micka33/install.md
cassandra on mac OSX

Installing Cassandra on Mac OS X

Install Homebrew

Homebrew is a great little package manager for OS X. If you haven't already, installing it is pretty easy:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@abhisheksliam
abhisheksliam / installing_cassandra.md
Created October 1, 2020 17:12 — forked from hkhamm/installing_cassandra.md
Installing Cassandra on Mac OS X

Installing Cassandra on Mac OS X

Install Homebrew

Homebrew is a great little package manager for OS X. If you haven't already, installing it is pretty easy:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@abhisheksliam
abhisheksliam / add.js
Created June 16, 2017 15:16 — forked from getify/add.js
an `add(..)` function that keeps going forever :)
function add() {
var sum = 0;
function add() {
for (var i=0; i<arguments.length; i++) {
sum += Number(arguments[i]);
}
return add;
}
add.valueOf = function valueOf(){
@abhisheksliam
abhisheksliam / promises.md
Created May 29, 2017 09:46 — forked from domenic/promises.md
You're Missing the Point of Promises

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.
@abhisheksliam
abhisheksliam / frontendDevlopmentBookmarks.md
Created December 26, 2016 12:18 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.
@abhisheksliam
abhisheksliam / install-charles-proxy.sh
Created November 6, 2016 18:24 — forked from heyalexej/install-charles-proxy.sh
install charles proxy from deb source
#!/usr/bin/env sh
set -e
# install charles proxy from deb sources.
# http://www.charlesproxy.com
sudo sh -c 'echo "deb http://www.charlesproxy.com/packages/apt/ charles-proxy main" > /etc/apt/sources.list.d/charles-proxy.list'
wget -q http://www.charlesproxy.com/packages/apt/PublicKey -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -y charles-proxy
@abhisheksliam
abhisheksliam / closure_and_scoping.js
Created July 26, 2016 19:10 — forked from madzak/closure_and_scoping.js
Javascript Interview Questions
/* Closures and Scoping */
!function(window) {
var body = window.getElementsByTagName('body')[0];
console.log(body);
}(document);
/*
Q: What would you expect the value of body to be?
@abhisheksliam
abhisheksliam / require-js-discussion.md
Created June 15, 2016 00:05 — forked from desandro/require-js-discussion.md
Can you help me understand the benefit of require.js?

I'm having trouble understanding the benefit of require.js. Can you help me out? I imagine other developers have a similar interest.

From Require.js - Why AMD:

The AMD format comes from wanting a module format that was better than today's "write a bunch of script tags with implicit dependencies that you have to manually order"

I don't quite understand why this methodology is so bad. The difficult part is that you have to manually order dependencies. But the benefit is that you don't have an additional layer of abstraction.


var application_root = __dirname,
express = require("express"),
path = require("path"),
mongoose = require('mongoose');
var app = express.createServer();
// database
mongoose.connect('mongodb://localhost/ecomm_database');