Skip to content

Instantly share code, notes, and snippets.

View muhammad-ammar's full-sized avatar

Muhammad Ammar muhammad-ammar

View GitHub Profile

Download videos from egghead

Go to the egghead website, i.e. Building a React.js App

run

$.each($('h4 a'), function(index, video){
  console.log(video.href);
});
@muhammad-ammar
muhammad-ammar / notify.py
Created June 6, 2017 10:00 — forked from lukaszb/notify.py
Simple Python script to send notification to the OSX Notifications Center (requires OS X 10.8+). Tested with pyobjc 2.5.1
#!/usr/bin/env python
from Foundation import NSUserNotification
from Foundation import NSUserNotificationCenter
from Foundation import NSUserNotificationDefaultSoundName
from optparse import OptionParser
def main():
parser = OptionParser(usage='%prog -t TITLE -m MESSAGE')
@muhammad-ammar
muhammad-ammar / ficus-devstack-2017-02-07
Created February 28, 2017 09:52
ficus devstack provisioning issues
task: `forum : initialize elasticsearch`
error:
{
"changed": true,
"cmd": ["/edx/app/forum/cs_comments_service/bin/rake", "search:initialize"],
"delta": "0:00:07.442933",
"end": "2017-02-28 07:07:22.888339",
"failed": true,
"rc": 1,
@muhammad-ammar
muhammad-ammar / README.md
Created October 1, 2016 21:15 — forked from hofmannsven/README.md
My simply Git Cheatsheet
import bleach
import markupsafe
from mako.template import Template
def HTML(html):
return markupsafe.Markup(html)
def remove_markup(html):
@muhammad-ammar
muhammad-ammar / gist:4104b3a436dfa3007dc773a3e31e7954
Created August 22, 2016 10:37 — forked from carlosmcevilly/gist:2221249
fix git commit with wrong email address in git config, before pushing
If:
- you add and commit with the wrong email address in git, and
- your remote has a hook set up to prevent you from pushing with the bad address
Then you need to amend the author of your commit before push can succeed:
1. fix your email address in git config:
$ git config user.name "Your Name"
@muhammad-ammar
muhammad-ammar / download-nltk-corpus.sh
Last active June 7, 2016 08:44
download nltk data
#!/usr/bin/env bash
export NLTK_DATA=/var/tmp/nltk_data
PYTHON=`which python`
sudo $PYTHON -m nltk.downloader stopwords maxent_treebank_pos_tagger wordnet -d /var/tmp/nltk_data
@muhammad-ammar
muhammad-ammar / ease_travis.yml
Created June 7, 2016 08:41
travis.yml for edx/ease
addons:
apt:
packages:
- aspell
- python-pip
- gcc
- g++
- gfortran
- libblas3gf
- libblas-dev
:syntax on
:autocmd FileType * set formatoptions=tcql nocindent comments&
:autocmd FileType c,cpp set formatoptions=croql cindent comments=sr:/*,mb:*,ex:*/,://
:
:set autoindent
:set autowrite
:ab #d #define
:ab #i #include
:ab #b /********************************************************
:ab #e ********************************************************/
@muhammad-ammar
muhammad-ammar / UnicodeEncodeError
Created November 25, 2015 14:44
UnicodeEncodeError
Destroying test database for alias 'default'...
(notes-venv)edxapp@precise64:/edx/src/edx-notes-api$ python manage.py test notesapi/v1/tests/test_views.py:AnnotationSearchViewTests.test_search_unicode
nosetests notesapi/v1/tests/test_views.py:AnnotationSearchViewTests.test_search_unicode --verbosity=1
Creating test database for alias 'default'...
Internal Server Error: /api/v1/search/
Traceback (most recent call last):
File "/edx/src/notes-venv/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/edx/src/notes-venv/local/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
return view_func(*args, **kwargs)