Skip to content

Instantly share code, notes, and snippets.

View agrawal-d's full-sized avatar
🧙‍♂️
Linux ate my ram

Divyanshu Agrawal agrawal-d

🧙‍♂️
Linux ate my ram
View GitHub Profile
@agrawal-d
agrawal-d / reset_usb_device.py
Created August 26, 2020 06:52 — forked from willstott101/reset_usb_device.py
Disable and enable a specific USB device.
#! /usr/bin/python3
import os
import argparse
from time import sleep
PATH = '/sys/bus/usb/devices/'
def reset_device(key, value, coerce, sleep_time):
for device_dir, dirs, files in os.walk(PATH, followlinks=True):
if device_dir != PATH:
@agrawal-d
agrawal-d / Zulip_GSoC_2020_Work_Product.md
Last active August 25, 2020 03:38
GSoC 2020 Work Product - Zulip

Google Summer Of Code 2020 - Zulip

Spending the summer working on Zulip, specifically Zulip Mobile, has been an amazing and enriching experience for me! I am very thankful to my mentors for guiding through the process of contributing to the project. In this document, I describe the contributions that I made to zulip-mobile during the summer.

What I worked on

A significant portion of my work was to add user-facing features to Zulip's React Native app. The

@agrawal-d
agrawal-d / .vimrc
Last active June 10, 2021 04:11
My Vim resource configuration file for the xub system
set nocompatible
syntax on
set number
set ruler
colorscheme one
set autoindent
set hlsearch " enable search highlighting
set wrap
set title
set shiftround
@agrawal-d
agrawal-d / .gitconfig
Created June 14, 2020 17:36
My .gitconfig configuration
[user]
email = <email here>
name = Divyanshu Agrawal
[alias]
last = log -1 HEAD
logline = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
[core]
symlinks = true
abbrev = 9
[color]
@agrawal-d
agrawal-d / .bashrc
Created June 14, 2020 17:35
My .bashrc config
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@agrawal-d
agrawal-d / git-change-commit-messages.md
Created January 28, 2020 12:51 — forked from nepsilon/git-change-commit-messages.md
How to change your commit messages in Git? — First published in fullweb.io issue #55

How to change your commit messages in Git?

At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.

Not pushed + most recent commit:

git commit --amend

This will open your $EDITOR and let you change the message. Continue with your usual git push origin master.

@agrawal-d
agrawal-d / Update-branch.md
Created January 24, 2020 17:56 — forked from santisbon/Update-branch.md
Bring your feature branch up to date with master. Deploying from Git branches adds flexibility. Bring your branch up to date with master and deploy it to make sure everything works. If everything looks good the branch can be merged. Otherwise, you can deploy your master branch to return production to its stable state.

Updating a feature branch

First we'll update your local master branch. Go to your local project and check out the branch you want to merge into (your local master branch)

$ git checkout master

Fetch the remote, bringing the branches and their commits from the remote repository. You can use the -p, --prune option to delete any remote-tracking references that no longer exist in the remote. Commits to master will be stored in a local branch, remotes/origin/master