Skip to content

Instantly share code, notes, and snippets.

View narainsagar's full-sized avatar
👋
email me for projects/work!!

Narain S. narainsagar

👋
email me for projects/work!!
View GitHub Profile
@narainsagar
narainsagar / dynamodb.md
Created April 26, 2019 23:26 — forked from jlafon/dynamodb.md
An Introduction to Amazon's DynamoDB

An introduction to DynamoDB

DynamoDB is a powerful, fully managed, low latency, NoSQL database service provided by Amazon. DynamoDB allows you to pay for dedicated throughput, with predictable performance for "any level of request traffic". Scalability is handled for you, and data is replicated across multiple availability zones automatically. Amazon handles all of the pain points associated with managing a distributed datastore for you, including replication, load balancing, provisioning, and backups. All that is left is for you to take your data, and its access patterns, and make it work in the denormalized world of NoSQL.

Modeling your data

The single most important part of using DynamoDB begins before you ever put data into it: designing the table(s) and keys. Keys (Amazon calls them primary keys) can be composed of one attribute, called a hash key, or a compound key called the hash and range key. The key is used to uniquely identify an item in a table. The choice of the primary key is particularl

@narainsagar
narainsagar / mailchimp_3.0.php
Last active December 4, 2024 19:39
How to Dynamically send a newsletter with MailChimp 3.0 via PHP
<?php
/**
* Reference Links:
* - https://mailchimp.com/help/find-your-list-id/
* - https://stackoverflow.com/a/48655086/5228251
* - https://thedebuggers.com/send-mailchimp-newsletter-via-php/
*/
// Include Mailchimp API 3.0
* Downloaded or downloading
=============================
**http://kickass.to/infiniteskills-learning-jquery-mobile-working-files-t7967156.html
**http://kickass.to/lynda-bootstrap-3-advanced-web-development-2013-eng-t8167587.html
**http://kickass.to/lynda-css-advanced-typographic-techniques-t7928210.html
**http://kickass.to/lynda-html5-projects-interactive-charts-2013-eng-t8167670.html
**http://kickass.to/vtc-html5-css3-responsive-web-design-course-t7922533.html
*http://kickass.to/10gen-m101js-mongodb-for-node-js-developers-2013-eng-t8165205.html
*http://kickass.to/cbt-nuggets-amazon-web-services-aws-foundations-t7839734.html

Learning Plan for Test Driven Development (TDD)

These learning resources primarily focus on Test Driven Development (TDD).

  • There is an emphasis on learning using PHP, Laravel and PHPUnit.
  • All these resources are free (at the time of writing)
@narainsagar
narainsagar / nodejs - get filesize in readable format.md
Last active January 14, 2022 05:33
node.js - function to get file and convert the file size in humanly readable format.

node.js - get the filesize in human readable format.

This will take filePath as a function parameter and reads the file via fs module and get the file and converts it's size into more humanly readable format.

const fs = require('fs');
function getFileSize(filename) {
  const stats = fs.statSync(filename);
  //console.log('stats', stats);
 const {size} = stats;
@narainsagar
narainsagar / create_new_ssh_key.md
Last active June 1, 2021 09:45 — forked from JoaquimLey/create_new_ssh_key.md
Generating a new SSH key and adding it to the ssh-agent
@narainsagar
narainsagar / download.md
Created December 8, 2016 15:37
Download a file with custom data and filename into browser (via Pure JS)

Define below method:

i.e., I have created this for my angular2 app. so this function is written in TypeScript

  createDownloadLink(filename: string, data: string) {
    var dataUri = 'data:application/octet-stream;charset=utf-8,' + encodeURIComponent(data);
    var anchor = document.createElement('a');

 anchor.setAttribute('href', dataUri);
@narainsagar
narainsagar / curated-learning-resources.md
Last active June 10, 2020 10:22
Curated List of Awesome Development & Programming learning resources / courses.
@narainsagar
narainsagar / students-entrance-exam-preparation-guide-and-tips.md
Last active May 24, 2020 17:16
Students Guide to University Entrance Test Exam Preparation & Tips for 🇵🇰🇮🇳 school/college students (URDU/HINDI)

School/College Students Guide to University Entrance Test Exam Preparation & Tips/Tricks 🇵🇰🇮🇳 (URDU/HINDI)

Description: This video is made up for those who are (higher) secondary school students or those who want to pursue his/her further studies (Graduation) in GOOD universities. In this video, I've highlight my experiences and thoughts and how I achieved my desired goals.

Hope you may find it useful and like this video.

Please LIKE and SHARE this video with your colleagues/friends and students who're currently doing preparation for Entrance Test Exam of Universities.

Also, please SUBSCRIBE my Youtube channel for more upcoming videos.