Skip to content

Instantly share code, notes, and snippets.

Avatar

M.Yasoob Ullah Khalid ☺ yasoob

View GitHub Profile
@yasoob
yasoob / barcode_generator.py
Last active Apr 15, 2021
A pure Python Universal Product Code A barcode generator.
View barcode_generator.py
import xml.dom
import os
class UPC:
"""
The all-in-one class that represents the UPC-A
barcode.
"""
View Installing wine1.8 on Ubuntu 14.04.md

Installing Wine 1.8 on Ubuntu 14.04

Wine is a Compatibility layer for running windows applications on Linux and Mac OSX. Instead of simulating internal Windows logic like a virtual machine or emulator, Wine translates Windows API calls into POSIX calls on-the-fly.

In this post I will show you how you can install Wine on Ubuntu 14.04. It is really easy to install it. We will be doing most of our work on the command-line using apt. It is the best and easiest way to add ppas and install pakages in linux.

Adding the PPA:

@yasoob
yasoob / post.md
Last active Dec 22, 2015
Flask login app.
View post.md

Making a Flask app with login functionality

Hi there guys! In this post I will share my experience with you while developing a Flask app with login functionality. The sourcecode of the app is available here.

We will be using the following libraries:

  • Flask (obviously)
  • Flask-SQLAlchemy
  • Jinja2
@yasoob
yasoob / myspace-dl.py
Created Jun 9, 2013
Myspace downloader
View myspace-dl.py
#!/usr/bin/env python3
import urllib.request
url = 'http://www.myspace.com/Modules/PageEditor/Handlers/Music/SearchMusic.ashx'
data = b'term=incomplete&maxArtists=10&maxSongs=20'
headers = {
'Hash':'MIGcBgkrBgEEAYI3WAOggY4wgYsGCisGAQQBgjdYAwGgfTB7AgMCAAECAmYDAgIAwAQIYLI97pYniaIEEEZ7OzdEz%2bIWLU44SUNWb30EUFjzQCE6jLLj9dgPm5be2u4N4ljriq5Up6l3RTd81ynC8UyNrmT8KElNy5%2bz8uxPHY3FdSDSgkJUuW3iF4SdT53bMvA8fAP2iOBxBMhGjy9d',
}
req = urllib.request.Request(url, data, headers)
@yasoob
yasoob / README
Created Dec 16, 2015 — forked from navinpai/README
Simple CSS Blinking Cursor
View README
Simple blinking cursor... code from http://xip.io/ ... Ofcourse I don't own the code! Just keeping it here as a reference of the CSS3 code used.
View md_to_rst.sh
# This script was created to convert a directory full
# of markdown files into rst equivalents. It uses
# pandoc to do the conversion.
#
# 1. Install pandoc from http://johnmacfarlane.net/pandoc/
# 2. Copy this script into the directory containing the .md files
# 3. Ensure that the script has execute permissions
# 4. Run the script
#
# By default this will keep the original .md file
View gist:ab683fb9fd00c9854ba4
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<!-- NAME: 1 COLUMN - BANDED -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Blurb: Top scientific news and thought provoking questions straight to you.</title>
<style type="text/css">
body,#bodyTable,#bodyCell{
height:100% !important;
margin:0;
View gist:818efb45b784f32170c0

Suppose I have three containers of variable width and height:

Container 1

-------------
|           |
|           |
|           |

| |

@yasoob
yasoob / gist:937b939b54dbf4d2b225
Created Jan 19, 2015
Solution for Problem one EdX
View gist:937b939b54dbf4d2b225
def payment(month, balance, AIRate, MPRate):
minimumPayment = balance * MPRate
remainingBalance = balance - minimumPayment
unpayedBalance = balance-minimumPayment
interest = (AIRate/12) * unpayedBalance
balance = unpayedBalance + interest
print "Month:", month
print "Minimum monthly payment: %.2f" %(minimumPayment)
View gist:ee0f8e905092744bfbea
"""
[JS] Jump Start: Your commandline companion
Commands:
js add <name> <file>
js rm (<name> | --all)
js show (--all | -a)
js <name>
Options: