Skip to content

Instantly share code, notes, and snippets.

View dufferzafar's full-sized avatar
🏠
Working from home

Shadab Zafar dufferzafar

🏠
Working from home
View GitHub Profile
@dufferzafar
dufferzafar / git bisect.log
Created November 11, 2014 20:12
Using Git Bisect
Welcome to cmder! customized by dufferzafar
D:\Github\IdeaBin (sql)
λ git bisect start
D:\Github\IdeaBin (sql)
λ gl
7e74633 2014-11-07 5 days ago Added frontend SQL queries (HEAD, origin/sql, sql)
a575c5c 2014-11-07 5 days ago comments SQL queries updated
d34b316 2014-11-07 5 days ago users SQL queries updated
@dufferzafar
dufferzafar / Rotate.ahk
Created November 22, 2014 11:01
A quick script I wrote while going through all my notes to move them to right using the Windows Image and Fax Viewer.
]::
SendInput, {Right} ; Start moving to next image
Sleep, 1000 ; Wait for the current image to save
SendInput, ^. ; Rotate image to the right
Return
@dufferzafar
dufferzafar / ideabin-bot-chat.txt
Last active August 29, 2015 14:10
Discussion with Aditya Kumar, explaining the IdeaBin Bot. Request for comments.
(11:59:58 PM) dZ: accha ideabin ke liye ek sharing service bana rha hun
(12:00:17 AM) dZ: ideas ko tweet karega, aur unki summary email karega
(12:09:37 AM) dZ: gists mein alread har feature toh hai hi
(12:09:51 AM) dZ: stars, comments, etc.
(12:10:01 AM) dZ: toh bas ab ek script bana rha hun
(12:10:12 AM) dZ: jo bando ki gists fetch karegi aur
(12:10:18 AM) dZ: unmein se ideas wali nikalegi
(12:10:33 AM) dZ: (the ones which have #ideabin in the description)
(12:10:57 AM) kwikadi: only gists?
(12:11:08 AM) dZ: hm
@dufferzafar
dufferzafar / Sort Github File List.md
Created December 2, 2014 12:12
Sort Github file list according to last modified time. #userscript #github #ideabin

Create a hotkey to sort the Github file list.

There is a userscript that does the same thing but it doesn't have hotkey support. I tried understanding the code but just couldn't wrap my head around it.

Hotkey could be added using the jQuery Hotkeys plugin.

@dufferzafar
dufferzafar / Command line utility to find number of days to a date.md
Created December 3, 2014 18:25
Command line utility to find number of days to a date. #go #cli #ideabin

Examples:

days -m | -y                # Print number of days left in the month/year

days "Aug 31"               # This year

days "Aug 31, 2016"         # Exact date

days "31/08/2019"           # Alternate date format
@dufferzafar
dufferzafar / A utility to generate random test databases.md
Created December 3, 2014 18:30
Python utility to generate random test databases. #python #dbms #random #ideabin

Similar to cheater which is written in Perl and Mockaroo which is web based.

Generating random data is not a problem as the faker package is quite nice.

The main task would be to correctly implement the 'SQL-Like little language' from cheater.

Rather than just supporting regexes, we could support all faker data types, like {first_name} for random first names etc. Mocakroo does this.

@dufferzafar
dufferzafar / Script that reminds you to commit.md
Last active August 29, 2015 14:10
A script that reminds you to commit. #github #python #ideabin

The script can run on a server (as a nightly cron job)

At every 9 PM it fetches the list of my commits for that day and shoots me an email/(sms?)/tweet/(google now reminder?) if i haven't committed any code.

Would be great in occassions when you accidentally end up breaking your streaks.

Could use Sendgrid for email services.

@dufferzafar
dufferzafar / Kick-Ass youtube-dl gui.md
Created December 5, 2014 22:00
A kick-ass GUI for youtube-dl #python #qt #ideabin

youtube-dl if you've not heard of it, is a great downloader for youtube (and a lot of other sites.)

The application has an awesome CLI, but a GUI could have things like:

  • Pause/Resume
  • Skip already downloaded files (-w)
  • Add all links from a playlist individually, so you can control their downloads individually.
  • Move downloads to folders based on categories/channels (I think this can already be done via output paths.)

Our GUI based app could be multi-threaded. (Async downloads?)

@dufferzafar
dufferzafar / Inorder.c
Last active August 29, 2015 14:11
In-order traversal of a Binary Search Tree without using stack or recursion.
#include <stdlib.h>
#include <stdio.h>
/**
* Node structure of the BST
*/
struct Node
{
int data;
struct Node* left;
@dufferzafar
dufferzafar / Build-HAC.sh
Created December 18, 2014 15:37
Built HAC from multiple chapters
# Remove the Initial page from all files.
for file in *.pdf
do
F:/Powerpack/Cmder/vendor/pdftk/pdftk.exe $file cat 2-end output "${file%.*}-new.pdf"
done
F:/Powerpack/Cmder/vendor/pdftk/pdftk.exe *-new*.pdf cat output "Handbook.pdf"
F:/Powerpack/Cmder/vendor/pdftk/pdftk.exe "toc3.pdf" "Handbook.pdf" cat output "Handbook of Applied Cryptography.pdf"