Skip to content

Instantly share code, notes, and snippets.

View Abdur-rahmaanJ's full-sized avatar
🛰️
Python, for the love of it!

Abdur-Rahmaan Janhangeer Abdur-rahmaanJ

🛰️
Python, for the love of it!
View GitHub Profile
@Abdur-rahmaanJ
Abdur-rahmaanJ / james-spurin-abdur-rahmaan-janhangeer-chat-transcript.txt
Created November 30, 2023 20:53
james-spurin-abdur-rahmaan-janhangeer-chat-transcript.txt
James:
Not really in the spirit of respect and community kindness
Your post is actually really good
And I actually commented this way in another group
But .. you didn’t actually cover what was mentioned in my post
Abdur-Rahmaan:
Oh i mean, your post is like the world is doing it wrong and you are doing it right
James:
#!/usr/bin/env python3.6.2
# -*- coding: utf-8 -*-
# run script from command line via python3 keyword_search_github_repositories.py
import click
import datetime
import time
from github import Github
postfix = ['111', '2', '+', '33', '2', '**', '+', '1', '1', '*', '-']
def is_number(num):
# quick way
return num[0] in '0123456789'
def eval_postfix(postfix):
stack = []
for element in postfix:
if is_number(element):
tokens = ['111', '+', '2', '+', '(', '33', '**', '2', ')', '-', '1', '*', '1']
# 111 2 + 33 2 ^ + 1 1 * -
def is_number(num):
# quick way
return (num[0] in '0123456789')
def to_postfix(tokens):
operators = {
'**': 3,
def identify_symbols(string):
elements = []
num_stack = [] # holds numbers
index = 0
while index < len(string):
char = string[index]
if char in '+-/*()':
# Add number to elements
if num_stack:
def isbalanced(string):
stack = []
for char in string:
if char == '(':
stack.append(char)
elif char == ')':
if not stack: # stack empty trying to remove
return False
else:
stack.pop()
# using rich console
def ensure_internet():
console = Console()
domains = [
'https://google.com',
'https://yahoo.com',
'https://bing.com',
'https://www.ecosia.org',
'https://www.wikipedia.org'
@Abdur-rahmaanJ
Abdur-rahmaanJ / count_class_and_funcs.py
Created October 5, 2020 19:11
Count number of classes and functions in the standard library
import ast
import os
stats = {
'funcs':0,
'classes':0,
'analysed':0
}
base_path = 'C:\\Python37-32\\Lib'
@Abdur-rahmaanJ
Abdur-rahmaanJ / webview.py
Created July 29, 2019 04:04 — forked from techtonik/webview.py
View HTML content in Python with PySide
"""
Placed into public domain by
anatoly techtonik <techtonik@gmail.com>
Show HTML in GUI window through PyQt4/PySide.
[ ] position window at the center of the screen
(right now it is middle bottom)
[ ] implement lazy loading for PyQt4/PySide
"""
@Abdur-rahmaanJ
Abdur-rahmaanJ / exploring_word_vectors.ipynb
Created July 24, 2019 17:12 — forked from ssghost/exploring_word_vectors.ipynb
My answers for Stanford on-line course CS224N Winter 2019 Assignment-1.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.