Skip to content

Instantly share code, notes, and snippets.

Rahul Bansal rahul286

View GitHub Profile
# This script takes a remote repository and merges it into
# the current one as a subdirectory
set -e
if [ -z "$1" ]
echo "Usage:"
rahul286 /
Last active Jul 11, 2018 — forked from milo2012/

Install deps using

pip install ipwhois

You may need to prefix above command with sudo if you are using python version that ships with system. Or change ownership (not recommended) by running sudo chown -R $USER /Library/Python/2.7

Download script and execute it

rahul286 / fb_friend_count.js
Last active Jun 22, 2018
Count Facebook Friend Requests You Receive Everyday
View fb_friend_count.js
// goto
// open js console
// insert jquery by copy-pasting
jQuery('#pagelet_all_activity_2018_6 ._5ep8').each(function (index) {
console.log( jQuery( this ).text() + " : " + jQuery(this).next('.uiList').find('a.profileLink').filter(':odd').length)
View linkedin-unfollow.js
# goto
# in JS console run
var buttons = $("button"),
interval = setInterval(function(){
var btn = $('.is-following');
console.log("Clicking:", btn);;
if (buttons.length === 0) {

Commit, clone a container

To 'clone' a container, you'll have to make an image of that container first, you can do so by "committing" the container. Docker will (by default) pause all processes running in the container during commit to preserve data-consistency.

For example;

docker commit --message="Snapshot of my container" my_container my_container_snapshot:yymmdd
rahul286 /
Created Jul 22, 2017
apt upgrade keeping old config file as it is
apt -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
rahul286 /
Last active Jul 21, 2017
rbenv on mac/ubuntu homebrew method gem bundler path fix
brew install rbenv ruby-build rbenv-bundler


rbenv --init
rahul286 /
Last active Jun 7, 2017
Pure non-vegetarian menu on Zomato and Swiggy🍗 😋

Open JavaScript console and run following codes on respective sites. 🍗 😋

It hides all vegeterian dishes from the menu!

Zomato -

rahul286 /
Last active Mar 21, 2017
sed extract numbers from filename

Sample file names from wp-cli export example.wordpress.2017-03-03.988.xml

ls -1 | sed 's/example.wordpress.[0-9]*-[0-9]*-[0-9]*.\([0-9]*\).xml$/\1/' 

Extracts 998

rahul286 / 0_reuse_code.js
Created Dec 28, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
You can’t perform that action at this time.