Skip to content

Instantly share code, notes, and snippets.

View ielshareef's full-sized avatar

Ismail Elshareef ielshareef

  • Los Angeles, CA
View GitHub Profile

Keybase proof

I hereby claim:

  • I am ielshareef on github.
  • I am ielshareef (https://keybase.io/ielshareef) on keybase.
  • I have a public key ASAm4oZdKu3bOz8wdqPMIkBfmAjZkWWZIRoo1jT_7Gi02Qo

To claim this, I am signing this object:

@ielshareef
ielshareef / parallel_exec_in_js.js
Created July 3, 2012 18:49
parallel execution and scope isolation in JavaScript
// functionality is broken across many code snippets wrapped in a function
var array_of_functions = [
function() {
// do something 1
},
function() {
// do something 2
},
function() {
// do something 3
@ielshareef
ielshareef / 0_how-to-use-embeddedmodelfield-in-django-admin.md
Created June 28, 2012 12:45
How to use EmbeddedModelField in Django's admin

How to Use EmbeddedModelField in Django's admin

by Ismail Elshareef

Problem

If you're using MongoDB with Django, you will need to manage ListField and EmbeddedModelField type fields in Django's admin module. Unfortunately, that's not so easy to do out of the box. You need to do some hacking to get it done. Here's a good link on how to use ListField in admin https://gist.github.com/1200165.

Now let's find out how we can use EmbeddedModelField with admin. Let's start hacking :)

@ielshareef
ielshareef / site_id_djangononrel_mongodb.md.md
Created June 25, 2012 04:13
Error on Django-nonrel and MongoDB: AutoField (default primary key) values must be strings representing an ObjectId on MongoDB (got u'1' instead). Please make sure your SITE_ID contains a valid ObjectId string.

Fixing SITE_ID for Django-nonrel and MongoDB

by Ismail Elshareef

Django's database setting are by default set to work with relational databases. Therefore, certain issues start popping up when you work with noSQL databases, like MongoDB.

Problem

If you're running Django-nonrel with Mongodb, you will run into an issue when you execute the following command: