Skip to content

Instantly share code, notes, and snippets.

View yasoob's full-sized avatar

M.Yasoob Ullah Khalid ☺ yasoob

View GitHub Profile
@yasoob
yasoob / barcode_generator.py
Last active October 26, 2022 13:24
A pure Python Universal Product Code A barcode generator.
import xml.dom
import os
class UPC:
"""
The all-in-one class that represents the UPC-A
barcode.
"""

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 December 22, 2015 15:23
Flask login app.

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 / README
Created December 16, 2015 23:29 — forked from navinpai/README
Simple CSS Blinking Cursor
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.
# 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
<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;

Suppose I have three containers of variable width and height:

Container 1

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

| |

@yasoob
yasoob / gist:937b939b54dbf4d2b225
Created January 19, 2015 16:06
Solution for Problem one EdX
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)
"""
[JS] Jump Start: Your commandline companion
Commands:
js add <name> <file>
js rm (<name> | --all)
js show (--all | -a)
js <name>
Options:
@yasoob
yasoob / myspace-dl.py
Created June 9, 2013 17:23
Myspace downloader
#!/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)