Skip to content

Instantly share code, notes, and snippets.

Imran Shahid ishahid

Block or report user

Report or block ishahid

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
View helloworld.bf
++++++++++ initialize counter (cell #0) to 10
[ use loop to set the next six cells to 70/80/90/100/30/10
> +++++ ++ add 7 to cell #1
> +++++ +++ add 8 to cell #2
> +++++ ++++ add 9 to cell #3
> +++++ +++++ add 10 to cell #4
> +++ add 3 to cell #5
> + add 1 to cell #6
<<<<<< - decrement counter (cell #0)
]
@ishahid
ishahid / exif.py
Last active Oct 22, 2017
Read EXIF data from an image
View exif.py
#!/usr/local/bin/python
"""Read EXIF data from an image
https://gist.github.com/ishahid/137f8724d8cff2304dffd69f3ade26d7
"""
try:
import os, sys
# import json
from PIL import Image
@ishahid
ishahid / viscosity-to-ovpn.py
Last active Oct 20, 2019
Convert all of your Viscosity connections into OVPN configuration files for OpenVPN
View viscosity-to-ovpn.py
#!/usr/bin/python
"""Convert all of your Viscosity connections into OVPN configuration files for OpenVPN
https://gist.github.com/ishahid/693c2c97b3236a3c2416fc09ab170244
"""
import re
import glob
from os.path import expanduser, dirname
View .bash_profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configuration and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
View keybase.md

Keybase proof

I hereby claim:

  • I am ishahid on github.
  • I am ishahid (https://keybase.io/ishahid) on keybase.
  • I have a public key whose fingerprint is DD3B DD86 B1D3 AD6B 2F49 722E 1451 55DE 0BAD E780

To claim this, I am signing this object:

@ishahid
ishahid / quote.py
Last active Feb 8, 2016
Get quote from stock market using Google Finance
View quote.py
#!/usr/bin/python
"""Get quote from stock market using Google Finance
https://gist.github.com/ishahid/9f0823c19b6d387529f4
"""
try:
import os, sys
import json
import googlefinance as google
@ishahid
ishahid / api-key.py
Last active Jan 6, 2016
Generates a random API key
View api-key.py
#!/usr/bin/python
"""Generate a random API key
https://gist.github.com/ishahid/54f0478e480234fa44ec
"""
import base64
import hashlib
import random
@ishahid
ishahid / git_commits_monthly
Created Mar 25, 2015
bash script to find monthly git commits by users on monthly basis
View git_commits_monthly
#/bin/bash
DATES=("2014-03-01" "2014-04-01" "2014-05-01" "2014-06-01" "2014-07-01" "2014-08-01" "2014-09-01" "2014-10-01" "2014-11-01" "2014-12-01" "2015-01-01" "2015-02-01" "2015-03-01")
let "counter = 1"
for i in "${DATES[@]}"
do
echo -n "$i"
echo
git shortlog -s -n --after=${DATES[counter-1]} --before=${DATES[counter]}
@ishahid
ishahid / docx.py
Last active Aug 29, 2015
Utility to replace variables enclosed in square brackets with the given value in Microsoft Word docx files. Based upon the following blog post. http://virantha.com/2013/08/16/reading-and-writing-microsoft-word-docx-files-with-python/
View docx.py
import os, re, zipfile, shutil, tempfile
from lxml import etree
class docx():
def __init__(self, docx_filename):
self.filename = docx_filename
with open(self.filename) as f:
self.zipfile = zipfile.ZipFile(f)
@ishahid
ishahid / sort_json_array.js
Created Feb 26, 2014
Generic way of sorting JSON array by attribute
View sort_json_array.js
function sort_by(attr) {
return function(a, b) {
if( a[attr] > b[attr]) {
return 1;
} else if( a[attr] < b[attr] ) {
return -1;
}
return 0;
}
}
You can’t perform that action at this time.