Skip to content

Instantly share code, notes, and snippets.

View AshishKapoor's full-sized avatar
🪂
Git gud, son!

AshishKapoor

🪂
Git gud, son!
View GitHub Profile
@AshishKapoor
AshishKapoor / arrayRotation.js
Created September 3, 2021 09:37
Array rotation
/*
Given an array, rotate the array to the right by k steps, where k is non-negative.
Example 1:
Input: nums = [1,2,3,4,5,6,7], k = 3
Output: [5,6,7,1,2,3,4]
Explanation:
rotate 1 steps to the right: [7,1,2,3,4,5,6]
rotate 2 steps to the right: [6,7,1,2,3,4,5]
@AshishKapoor
AshishKapoor / mergeWords.js
Last active September 3, 2021 09:09
Merge words
/*
Create a function that will allow you to pass in a string, with the ability to add to this with more function calls.
When it is finally passed an empty argument returns the full concatenated string of all arguments passed previously.
// For example: mergeWords("Hello")("World!")("how")("are")("you?")();
// This will return the following: "Hello World! how are you?"
*/
@AshishKapoor
AshishKapoor / fizzbuzz.js
Last active September 3, 2021 09:09
Fizzbuzz problem
/*
Write a program that prints the numbers from 1 to 100. But for multiples
of three print “Fizz” instead of the number and for the multiples of five print “Buzz”.
For numbers which are multiples of both three and five print “FizzBuzz”.
*/
@AshishKapoor
AshishKapoor / vscode_shortcuts.md
Created July 11, 2021 12:18 — forked from bradtraversy/vscode_shortcuts.md
Helpful shortcuts for VSCode

VSCode Shortcuts

List of helpful shortcuts for faster coding

If you have any other helpful shortcuts, feel free to add in the comments of this gist :)

Official List of all commands

@AshishKapoor
AshishKapoor / sql-basics.sql
Created May 11, 2021 23:24
Basics of structured query language
SQL BASICS
CREATE DATABASE local;
-- tell mysql which database to work with
USE local;
-- create a table with a column
create table test (
@AshishKapoor
AshishKapoor / kafka.md
Last active December 7, 2020 08:30
Quick Kafka

Install kafka/zookeeper and start servers

$ brew install kafka
$ brew install zookeeper

$ zkServer start
$ kafka-server-start /usr/local/etc/kafka/server.properties

Create a topic

@AshishKapoor
AshishKapoor / mousewheel.sh
Created October 13, 2020 06:16
mousewheel.sh
#!/bin/bash
# Version 0.1 Tuesday, 07 May 2013
# Comments and complaints http://www.nicknorton.net
# GUI for mouse wheel speed using imwheel in Gnome
# imwheel needs to be installed for this script to work
# sudo apt-get install imwheel
# Pretty much hard wired to only use a mouse with
# left, right and wheel in the middle.
# If you have a mouse with complications or special needs,
# use the command xev to find what your wheel does.
@AshishKapoor
AshishKapoor / hosts
Created May 20, 2020 09:31
Self control on works machine
# /etc/hosts
# BEGIN WORK MACHINE BLOCK
0.0.0.0 facebook.com
:: facebook.com
0.0.0.0 linkedin.com
:: linkedin.com
0.0.0.0 amazon.in
:: amazon.in
0.0.0.0 instagram.com
@AshishKapoor
AshishKapoor / iterm2.md
Created February 23, 2020 21:03 — forked from squarism/iterm2.md
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@AshishKapoor
AshishKapoor / docker-help.md
Created August 19, 2019 19:41 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info