Skip to content

Instantly share code, notes, and snippets.

View yashhere's full-sized avatar

Yash Agarwal yashhere

View GitHub Profile
@yashhere
yashhere / MATRIX.md
Created August 25, 2017 16:03 — forked from fstab/MATRIX.md
How to use matrix.org and vector.im as an IRC client

How to use matrix.org and vector.im as an IRC client

How to Join an IRC Channel on matrix.org

Join the room #freenode_<#channel>:matrix.org, replacing <#channel> with the name of the IRC channel. For example, in order to join the #prometheus IRC channel, join the room #freenode_#prometheus:matrix.org on matrix.org.

In vector.im, rooms can be joined with the directory symbol on the bottom left.

@yashhere
yashhere / group-github-guide.md
Created January 12, 2018 12:09
A basic guide on working with Git as a group.

Using Git As A Group (DevMountain)

Geordyn Ader - Mentor - Dallas, TX Campus

Getting Started - Choose ONE person from your group to take care of the following steps

  1. Go to GitHub and click the + in the top right corner. Click New Organization.
  2. Name your organization (make it relevant).
  3. Add email for ‘billing’; do not worry, it’s free
  4. Choose the Free Plan
@yashhere
yashhere / open_source_at_mozilla_intro.md
Created February 14, 2018 11:49 — forked from mjzffr/open_source_at_mozilla_intro.md
This is an excerpt of an email exchange I had with a student interested in contributing to Mozilla's open source projects. The notes and resources are aimed at someone who has knowledge of programming (1st-year CS, say) but little or no knowledge of version control. Feel free to remix, reuse. :)

Hey ---, nice to talk with you yesterday! Giant email ahead!

Here's what we talked about:

All open source projects use version control tools like git for code submission. Mozilla uses two version control tools (hg and git) to track the history of code changes: hg (also called mercurial) is used for Firefox code, git is used for other supporting projects. The underlying concepts for hg and git are similar, but I think the documentation for git is much better so I suggest you focus on git first. Github is a web-based user interface for git. Locally (i.e. "on your computer"), you will interact with git using the terminal instead by entering commands. Version control is all about tracking project history so that it's easy to merge work from many different people or go back in time; it's an extra step/tool in software development on top of writing/testing your code.

To start working on any open source project, the first step is to get a copy of the source code repository (e.g. git clone). Then the programmer ch

@yashhere
yashhere / gist:644b8741b31b96bd2a1d03ddb27b931c
Created February 14, 2018 14:01 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@yashhere
yashhere / go-shebang-story.md
Created February 21, 2018 06:12 — forked from posener/go-shebang-story.md
Story: Writing Scripts with Go

Story: Writing Scripts with Go

This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.

Why Go is good for scripting?

While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.

@yashhere
yashhere / gist:cd695ec46618f56adf90a2fccdc0c5e6
Created June 20, 2018 19:08 — forked from lrei/gist:1510028
Fetch RSS Feeds Using Multiple Processes
#!/usr/bin/env python
import Queue
import multiprocessing
import urllib2
import feedparser
import socket
feeds = ['http://today.reuters.com/rss/topNews',
'http://today.reuters.com/rss/domesticNews',
@yashhere
yashhere / System Design.md
Last active May 11, 2019 13:06 — forked from vasanthk/System Design.md
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?
@yashhere
yashhere / nginx-tuning.md
Created May 17, 2019 09:10 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

The situation

Searching can be an efficient way to navigate the current buffer.

The first search commands we learn are usually / and ?. These are seriously cool, especially with the incsearch option enabled which lets us keep typing to refine our search pattern. / and ? really shine when all we want is to jump to something we already have our eyeballs on but they are not fit for every situation:

  • when we want to search something that's not directly there, those two commands can make us loose context very quickly,
  • when we need to compare the matches.

A better way