Skip to content

Instantly share code, notes, and snippets.

View sahas-'s full-sized avatar

Sahas sahas-

  • Chicago, IL
View GitHub Profile
@sahas-
sahas- / what-is-a-cell.md
Last active April 7, 2024 14:03
In Cell-Based Architecture, what is a Cell?

What is a Cell

A Cell

  • Is a module that aggregates business capabilities and manages their internal intricacies.

  • Is a self-contained unit that groups functionalities together based on business capabilities into a single cohesive unit.

  • Might internally use sub-components to achieve the complex business tasks but these components wouldn’t be separately deployable.

  • Has clear and well-established boundaries that define its area of responsibility, data ownership and exposes explicit interfaces. Can leverage various communication mechanisms such as APIs, events and messages.

BRIDGE_NET = "192.168.1."
INTERNAL_NET="192.168.100."
DOMAIN ="test.com"
RAM=524
CPU=1
servers=[
{
:hostname => "app1." + DOMAIN,
:box => "ubuntu/trusty64",
:ip => INTERNAL_NET + "10",
@sahas-
sahas- / launch.json
Created June 14, 2017 21:31
Python debug in vscode
{
"version": "0.2.0",
"configurations": [
{
"name": "Python",
"type": "python",
"request": "launch",
"stopOnEntry": true,
"pythonPath": "/usr/local/bin/python3",
"program": "${file}",
@sahas-
sahas- / Python getter_setter
Created June 14, 2017 21:22
Python getter_setter
class Employee(object):
def __init__(self,obj):
self.__set_employee(obj)
def __get_employee(self):
return self.__employee
def __set_employee(self,employee):
self.__employee = employee
var queue = require('queue');
var input = [1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13];
var q = queue();
q.concurrency = 1;
function test(element) {
return (function (cb) {
setTimeout(function() {
console.log(element);
cb();
'use strict';
var Q = require('q');
function test(){
var _test = Q.all([getPromise(1),getPromise(2),getPromise(3)]);
_test.spread(function(one,two,three){
console.log("one.."+one);
console.log("two.."+two);
console.log("three.."+three);
// Overwrite settings by placing them into your settings file.
{
//-------- Editor configuration --------
// Controls the font family.
"editor.fontFamily": "",
// Controls the font size.
"editor.fontSize": 0,
--
Recursive: go thru recursion everytime.
class test{
fib(n: number){
if (n<= 2) return 1;
return this.fib(n-1) + this.fib(n-2);
}
}
var f = new test()
var es = require('elasticsearch');
module ejs{
export class Ops{
update(){
let action = {'update': {'_id': 'AVBjrkfgjt6ZxwHlJ1w5'}};
let data = {"doc":{"more data":{"dob":1981,"place":"TN"}}};
let _client = new es.Client({host:"http://192.168.99.111:9200"});
_client.bulk({
index:'elasticsearch',
type:'hack',
{
"took": 10,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 1,