Skip to content

Instantly share code, notes, and snippets.

Working from home

Shadab Zafar dufferzafar

Working from home
View GitHub Profile
dufferzafar /
Created Jan 14, 2021 — forked from foulegg/
Generate a ClearTax capital gains report using the capital gains statement from Kuvera (depends on beautifulsoup4 and openpyxl)

Installing dependencies

This script requires two Python dependencies: beautifulsoup4 and openpyxl. Install them first using pip:

$ pip install beautifulsoup4
$ pip install openpyxl

You might have to use sudo if installing globally.

dufferzafar /
Last active Nov 1, 2018 — forked from bocon13/
Difference from the fork: PEP8 + Fix "Could not find a default OpenFlow controller" issue
from mininet.node import OVSController
from mininet.topo import SingleSwitchTopo
from import Mininet
from mininet.log import lg
from mininet.cli import CLI
dufferzafar / interviewitems.MD
Created Dec 8, 2016 — forked from KWMalik/interviewitems.MD
My answers to over 100 Google interview questions
View interviewitems.MD

##Google Interview Questions: Product Marketing Manager

  • Why do you want to join Google? -- Because I want to create tools for others to learn, for free. I didn't have a lot of money when growing up so I didn't get access to the same books, computers and resources that others had which caused money, I want to help ensure that others can learn on the same playing field regardless of their families wealth status or location.
  • What do you know about Google’s product and technology? -- A lot actually, I am a beta tester for numerous products, I use most of the Google tools such as: Search, Gmaill, Drive, Reader, Calendar, G+, YouTube, Web Master Tools, Keyword tools, Analytics etc.
  • If you are Product Manager for Google’s Adwords, how do you plan to market this?
  • What would you say during an AdWords or AdSense product seminar?
  • Who are Google’s competitors, and how does Google compete with them? -- Google competes on numerous fields: --- Search: Baidu, Bing, Duck Duck Go
dufferzafar /
Created Nov 3, 2016 — forked from abishur/
A simple menu system using python for the Terminal (Framebufer)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Topmenu and the submenus are based of the example found at this location
# The rest of the work was done by Matthew Bennett and he requests you keep these two mentions when you reuse the code :-)
# Basic code refactoring by Andrew Scheller
from time import sleep
import curses, os #curses is the interface for capturing key presses on the menu, os launches the files
screen = curses.initscr() #initializes a new window for capturing key presses
curses.noecho() # Disables automatic echoing of key presses (prevents program from input each key twice)
dufferzafar /
Created Feb 3, 2016 — forked from mislav/
"Pagination 101" by Faruk Ateş

Pagination 101

Article by Faruk Ateş, [originally on][original] which is currently down

One of the most commonly overlooked and under-refined elements of a website is its pagination controls. In many cases, these are treated as an afterthought. I rarely come across a website that has decent pagination, and it always makes me wonder why so few manage to get it right. After all, I'd say that pagination is pretty easy to get right. Alas, that doesn't seem the case, so after encouragement from Chris Messina on Flickr I decided to write my Pagination 101, hopefully it'll give you some clues as to what makes good pagination.

Before going into analyzing good and bad pagination, I want to explain just what I consider to be pagination: Pagination is any kind of control system that lets the user browse through pages of search results, archives, or any other kind of continued content. Search results are the o

dufferzafar /
Created Jan 27, 2016 — forked from mkaito/
This takes my playlists, managed by mpd, fixes them up, and places them in a staging folder, ready to sync with my Android phone. The script also asks if you'd like to sync the music after staging. Who needs iTunes anyway.
#!/usr/bin/env zsh
# Takes all my playlists from ~/.mpd/playlists, fixes them up, and creates a
# folder for each, along with the music they reference.
# The sync stage requires an sshd server to run on your phone, as well as the rsync executable.
# -
MPD_MUSIC_ROOT="${HOME}/Music" # Root of your MPD library
MPD_PLAYLIST_ROOT="${HOME}/.mpd/playlists" # MPD playlist folder
# credits to:
# Install:
# curl -O
# chmod u+x
# ./
# Extra:
# it is good to make a new user on both host and remote (
# useradd -m -s /bin/false autossh
View debian-wvdial-ppp0-interface-autossh.markdown

Reverse proxy over 3G modem (draft)

We will explain how to configure a cubieboard running debian as a reverese proxy. The modules that will be used are wvdial and autossh

Credits goes to:

dufferzafar /
Created Nov 28, 2015 — forked from pklaus/
A pure python ping implementation using raw socket.
#!/usr/bin/env python2
Other Repositories of python-ping
* supports Python2 and Python3
dufferzafar / TileLayer.Common.js
Last active Aug 29, 2015 — forked from mourner/TileLayer.Common.js
Leaflet shortcuts for common tile providers
View TileLayer.Common.js
// Lefalet shortcuts for common tile providers - is it worth adding such 1.5kb to Leaflet core?
L.TileLayer.Common = L.TileLayer.extend({
initialize: function (options) {, this.url, options);
(function () {