Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Shadab Zafar dufferzafar

🏠
Working from home
View GitHub Profile
View git bisect.log
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 Nov 22, 2014
A quick script I wrote while going through all my notes to move them to right using the Windows Image and Fax Viewer.
View Rotate.ahk
]::
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 Aug 29, 2015
Discussion with Aditya Kumar, explaining the IdeaBin Bot. Request for comments.
View ideabin-bot-chat.txt
(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 Dec 2, 2014
Sort Github file list according to last modified time. #userscript #github #ideabin
View Sort Github File List.md

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 / A utility to generate random test databases.md
Created Dec 3, 2014
Python utility to generate random test databases. #python #dbms #random #ideabin
View A utility to generate random test databases.md

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 / Command line utility to find number of days to a date.md
Created Dec 3, 2014
Command line utility to find number of days to a date. #go #cli #ideabin
View Command line utility to find number of days to a date.md

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 / Script that reminds you to commit.md
Last active Aug 29, 2015
A script that reminds you to commit. #github #python #ideabin
View Script that reminds you to commit.md

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 Dec 5, 2014
A kick-ass GUI for youtube-dl #python #qt #ideabin
View Kick-Ass youtube-dl gui.md

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 Aug 29, 2015
In-order traversal of a Binary Search Tree without using stack or recursion.
View Inorder.c
#include <stdlib.h>
#include <stdio.h>
/**
* Node structure of the BST
*/
struct Node
{
int data;
struct Node* left;
@dufferzafar
dufferzafar / Build-HAC.sh
Created Dec 18, 2014
Built HAC from multiple chapters
View Build-HAC.sh
# 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"