Skip to content

Instantly share code, notes, and snippets.

View NishiGaba's full-sized avatar
:octocat:

Nishi Gaba NishiGaba

:octocat:
  • India
View GitHub Profile
@NishiGaba
NishiGaba / git-deployment.md
Created October 21, 2020 17:48 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@NishiGaba
NishiGaba / array_iteration_thoughts.md
Created July 6, 2020 08:01 — forked from ljharb/array_iteration_thoughts.md
Array iteration methods summarized

While attempting to explain JavaScript's reduce method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.

Intro

JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it much simpler to think about both the old list and the new one, what they contain, and

@NishiGaba
NishiGaba / git-clearHistory
Created February 6, 2020 03:23 — forked from stephenhardy/git-clearHistory
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git
@NishiGaba
NishiGaba / README.md
Created January 21, 2020 03:52 — forked from hofmannsven/README.md
Git Cheatsheet
@NishiGaba
NishiGaba / The Technical Interview Cheat Sheet.md
Created January 21, 2020 03:46 — forked from gauravmehla/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@NishiGaba
NishiGaba / lamp.md
Last active February 26, 2018 14:37
LAMP setup on LINUX MINT or Ubuntu 16.04
@NishiGaba
NishiGaba / indexOf.js
Created July 19, 2017 12:32
Return original index in an ng-repeat through indexOf
//indexOf always returns the original index in an ng-repeat
<div ng-repeat="image in images">
{{images.indexOf(image)}}
</div>
@NishiGaba
NishiGaba / media_controls.html
Last active April 27, 2020 12:07
Hide Audio and Video Download Controls
<body>
<audio controls>
<source src="your_mp3_file" type="audio/mpeg">
</audio>
<video width="100%" height="100%" controls>
<source src="your_video_url">
</video>
</body>
@NishiGaba
NishiGaba / regex.js
Last active August 1, 2017 07:15
Regex for different combinations in Javascript
//Regex for only Alphanumeric Characters with Space Included
var regex = new RegExp("^[a-zA-Z ]+$");
//Verifying Contact Number
var contact = 1234567890;
var isnum = /^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/.test(contact);
//You can Refer this site for more Regex or You can Create your own Regex : http://regexr.com/
@NishiGaba
NishiGaba / upload_image.js
Last active August 1, 2017 07:14
Upload Image on Amazon S3
//Upload Image on Amazon S3 using Angular JS
$scope.loadImage = function() {
var input = document.getElementById('imgId');
var file = input.files[0];
//-------------- UPLOAD IMAGE ON AMAZON S3 -----------------//
$scope.creds = {
bucket: 'bucket',
access_key: '123XYZ',