Skip to content

Instantly share code, notes, and snippets.

View subratastack's full-sized avatar
🎯
Focusing

Subrata Banerjee subratastack

🎯
Focusing
View GitHub Profile
#IAM Permission needed: dynamodb:query
import json
import sys
import boto3
from boto3.dynamodb.conditions import Key, Attr
dynamodb = boto3.resource('dynamodb')
def lambda_handler(event, context):

Interview Questions

Node.js

Q1: What do you mean by Asynchronous API? ☆☆

Answer: All APIs of Node.js library are aynchronous that is non-blocking. It essentially means a Node.js based server never waits for a API to return data. Server moves to next API after calling it and a notification mechanism of Events of Node.js helps server to get response from the previous API call.

Source: tutorialspoint.com

@alexsc6955
alexsc6955 / -padding.styl
Last active September 22, 2021 21:30
Stylus padding mixin
/**
* Name: Stylus -padding mixin
* Description: Mixin to set paddings
* Author: Santiago Rincón
* Author URI: http://github.com/rincorpes
* Version: 2.0
* License: GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
* License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
*/
-padding()
@vasanthk
vasanthk / System Design.md
Last active September 23, 2024 06:28
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@maximilian-lindsey
maximilian-lindsey / express_in_electron.md
Last active August 4, 2024 08:08
How to run Express inside an Electron app

How to run Express inside an Electron app

You can run your Express app very easily inside your Electron app.

All you need to do is to:

  • place all the files of your Express app inside a new app folder in your_electron_app\resources\app
  • reconfigure the app.js file
  • refactor some relative pathes in your Express app
@kristw
kristw / bubbleChart.js
Last active April 15, 2018 15:24
angular + d3Kit Bubble chart
// Define bubble chart
var BubbleChart = d3Kit.factory.createChart(
// First argument is the default options for this chart
{
margin: {top: 60, right: 60, bottom: 60, left: 60},
initialWidth: 800,
initialHeight: 460
},
// The second argument is an Array that contains
// names of custom events from this chart.
@dmitrykuznetsovdev
dmitrykuznetsovdev / _mixins.styl
Created February 25, 2013 07:44
mixins.stylus
// Display:
// appearance
// box-align
// box-flex
// box-sizing
// box-orient
// box-pack
// display-box
// overflow-sroll
// user-select
@charlieschwabacher
charlieschwabacher / mixins.scss
Created July 21, 2011 07:41
SCSS mixins for cross browser CSS3 border-radius, transition, gradient, and box shadow
//Cross browser CSS3 mixins
@mixin box-shadow($left, $top, $radius, $color) {
box-shadow: $left $top $radius $color;
-webkit-box-shadow: $left $top $radius $color;
-moz-box-shadow: $left $top $radius $color;
}
@mixin transition($property, $duration, $easing: linear) {
transition: $property $duration $easing;