Skip to content

Instantly share code, notes, and snippets.

Rahul Bansal rahul286

Block or report user

Report or block rahul286

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rahul286
rahul286 / ddd.md
Created Apr 23, 2019 — forked from zsup/ddd.md
Documentation-Driven Development (DDD)
View ddd.md

Documentation-Driven Development

The philosophy behind Documentation-Driven Development is a simple: from the perspective of a user, if a feature is not documented, then it doesn't exist, and if a feature is documented incorrectly, then it's broken.

  • Document the feature first. Figure out how you're going to describe the feature to users; if it's not documented, it doesn't exist. Documentation is the best way to define a feature in a user's eyes.
  • Whenever possible, documentation should be reviewed by users (community or Spark Elite) before any development begins.
  • Once documentation has been written, development should commence, and test-driven development is preferred.
  • Unit tests should be written that test the features as described by the documentation. If the functionality ever comes out of alignment with the documentation, tests should fail.
  • When a feature is being modified, it should be modified documentation-first.
  • When documentation is modified, so should be the tests.
View merge_repos.sh
#!/bin/bash
# This script takes a remote repository and merges it into
# the current one as a subdirectory
set -e
if [ -z "$1" ]
then
echo "Usage:"
@rahul286
rahul286 / README.md
Last active Jul 11, 2018 — forked from milo2012/genPunycodeDomain.py
genPunycodeDomain.py
View README.md

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
rahul286 / fb_friend_count.js
Last active Jun 22, 2018
Count Facebook Friend Requests You Receive Everyday
View fb_friend_count.js
// goto https://www.facebook.com/rahulb286/allactivity?privacy_source=activity_log&log_filter=receivedfriendrequests
// open js console
// insert jquery by copy-pasting http://code.jquery.com/jquery-latest.min.js
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 https://www.linkedin.com/feed/following/
# in JS console run
var buttons = $("button"),
interval = setInterval(function(){
var btn = $('.is-following');
console.log("Clicking:", btn);
btn.click();
if (buttons.length === 0) {
clearInterval(interval);
View docker-examples.md

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
rahul286 / apt-upgrade.sh
Created Jul 22, 2017
apt upgrade keeping old config file as it is
View apt-upgrade.sh
apt -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
@rahul286
rahul286 / rbenv-mac.md
Last active Jul 21, 2017
rbenv on mac/ubuntu homebrew method gem bundler path fix
View rbenv-mac.md
brew install rbenv ruby-build rbenv-bundler

Run

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

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

It hides all vegeterian dishes from the menu!


Zomato - https://www.zomato.com/

$('.veg').parent().parent().parent().parent().parent().hide()
@rahul286
rahul286 / wp-cli-sed.md
Last active Mar 21, 2017
sed extract numbers from filename
View wp-cli-sed.md

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

You can’t perform that action at this time.