Skip to content

Instantly share code, notes, and snippets.

View myusuf3's full-sized avatar
Working from home

Mahdi Yusuf myusuf3

Working from home
View GitHub Profile
myusuf3 /
Last active September 20, 2017 13:49
script to check if apple site is up and running again.
from lxml import etree, html
import time
import requests
def main():
response = requests.get('')
body = response.text
myusuf3 / banal-apps.txt
Last active August 29, 2015 14:16
Merely gathering up a list of apps that people are tired of rolling their own constantly. I would love to hear what you guys would want built out once and for all.
- banal-signup (user management)
- banal-payments (cash money)
- banal-betalist (beta list hype tools)
myusuf3 /
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
# Curl and run this script as part of your .travis.yml before_script section:
# before_script:
# - curl | bash
myusuf3 / gist:5681305
Last active December 17, 2015 22:19 — forked from anonymous/gist:5681076
for k,v in propertyDict:
for k1,v2 in propertyDict[k]:
print('---' + k1 + '---' + propertyDict[k][k1])
# Then you can do things like, etc.
pip install -r requirements.txt -u prod
myusuf3 /
Created April 23, 2013 07:01
Simple little profiling decorator in python.
import cProfile
def profile_this(fn):
def profiled_fn(*args, **kwargs):
# name for profile dump
fpath = fn.__name__ + '.profile'
prof = cProfile.Profile()
ret = prof.runcall(fn, *args, **kwargs)
myusuf3 /
Created January 18, 2013 18:30
Python 2.7.2 (default, Jun 20 2012, 16:23:33)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from __future__ import braces
File "<stdin>", line 1
SyntaxError: not a chance
myusuf3 /
Created December 10, 2012 20:38
Code of Conduct: Open Source

I am writing this mostly out of frustration with developers. Hopefully this can shine some rules of conduct when discussing software on a medium like Github.

Being a developer, I understand that there are many things combating beautifully crafted software but thats the beauty of open source:

- Your time. 
- Your release dates. 
- Your requirements.

Another beauty of open source is collaboration and collective effort to craft better software .

myusuf3 /
Created October 29, 2012 18:45
example of function resolution
from django.db import models
from datetime import datetime
class AwesomePeople(models.Model):
# this will always be the date the code was loaded.
date_create = models.DatetimeField(
name = models.CharField(max_length=100)