Skip to content

Instantly share code, notes, and snippets.

View nishant8BITS's full-sized avatar
🎯
Focusing

Nishant Kumar nishant8BITS

🎯
Focusing
View GitHub Profile
### Keybase proof
I hereby claim:
* I am nishant8bits on github.
* I am nkumar8 (https://keybase.io/nkumar8) on keybase.
* I have a public key ASD8TeHR5WpX28scX7tY9MfS63Q8vgh7Ce4l9WqV7nd0Qwo
To claim this, I am signing this object:
@nishant8BITS
nishant8BITS / s3_upload_signed_url.js
Created June 25, 2019 16:02
Upload file to Amazon S3 using signed URL in Node.js
var AWS = require('aws-sdk');
var fs = require('fs');
var http = require('https');
var url = require('url');
var request = require('request');
var s3 = new AWS.S3({
accessKeyId: 'KEY',
secretAccessKey: 'SECRET',
region: 'eu-west-1'
@nishant8BITS
nishant8BITS / .block
Created April 11, 2019 14:02
fresh block
license: mit
@nishant8BITS
nishant8BITS / web-performance.md
Created April 2, 2019 11:24 — forked from stevekinney/web-performance.md
Web Performance Workshop

Web Performance

Requirements

Repositories

@nishant8BITS
nishant8BITS / MySQL_macOS_Sierra.md
Created November 30, 2018 20:30 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@nishant8BITS
nishant8BITS / install virtualenv ubuntu 16.04.md
Created November 24, 2018 16:21 — forked from Geoyi/install virtualenv ubuntu 16.04.md
How to install virtual environment on ubuntu 16.04

How to install virtualenv:

Install pip first

sudo apt-get install python3-pip

Then install virtualenv using pip3

sudo pip3 install virtualenv 
@nishant8BITS
nishant8BITS / LateBinding.js
Created October 9, 2018 11:08 — forked from abhiomkar/LateBinding.js
Early Binding & Late Binding in JavaScript
// Early Binding vs Late Binding
// Early Binding
var sum = function(a, b) {
return a + b;
};
var x = 5, y = 6;
var sum5n6 = sum.bind(null, x, y);
@nishant8BITS
nishant8BITS / media.js
Last active July 19, 2018 09:38
Media Query Utils for Style-Components
import { css } from 'styled-components';
const sizes = {
largedesktop:1200,
desktop: 992,
tablet: 768,
phone: 576
}
@nishant8BITS
nishant8BITS / node-folder-structure-options.md
Created June 29, 2018 18:59 — forked from lancejpollard/node-folder-structure-options.md
What is your folder-structure preference for a large-scale Node.js project?

What is your folder-structure preference for a large-scale Node.js project?

0: Starting from Rails

This is the reference point. All the other options are based off this.

|-- app
|   |-- controllers
|   |   |-- admin
function translateError(msg) {
var newErr = new Error(msg); // placed here to get correct stack
return e => {
newErr.originalError = e;
throw newErr;
}
}
async function asyncTask() {
const user = await UserModel.findById(1).catch(translateError('No user found'))