Skip to content

Instantly share code, notes, and snippets.

Emad Mokhtar EmadMokhtar

Block or report user

Report or block EmadMokhtar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@EmadMokhtar
EmadMokhtar / fix_name.py
Created May 1, 2019
Notion notes sanitizer
View fix_name.py
import os
current_dir = os.getcwd()
files_extension = ['.md', '.txt', '.docx']
bad_chars = {
'#': 'hash',
'|': '',
'[': '',
']': '',
@EmadMokhtar
EmadMokhtar / 1
Created Apr 15, 2018
vscode-settings
View gist:566f8ec56f042b9b1a4e9a659a0a74e0
### Keybase proof
I hereby claim:
* I am emadmokhtar on github.
* I am emadmokhtar (https://keybase.io/emadmokhtar) on keybase.
* I have a public key ASAZ962lbDefTMLu0vyjegeRC2QM1Hc3EDypBatUNXcloAo
To claim this, I am signing this object:
@EmadMokhtar
EmadMokhtar / Django + Ajax dynamic forms .py
Created Jan 4, 2018 — forked from goldhand/Django + Ajax dynamic forms .py
Django form with Ajax. A simple Task model that can be updated using a CBV with an AJAX mixin. The view sends post data with ajax then updates the view with a callback to a DetailView with a json mixin.There is an abstract CBV, AjaxableResponseMixin, based on the example form django docs, that is subclassed in the TaskUpdateView CBV. TaskUpdateV…
View Django + Ajax dynamic forms .py
#models.py
class Task(models.Model):
title = models.CharField(max_length=255)
description = models.TextField()
def __unicode__(self):
return self.title
View quick_sort_recursive.py
def partition(alist, start, end):
pos = start
for i in range(start, end):
if alist[i] < alist[end]:
alist[i], alist[pos] = alist[pos], alist[i]
pos += 1
alist[pos], alist[end] = alist[end], alist[pos]
return pos
def quicksort(alist, start, end):
View init.coffee
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
View AuditTrailWithUsername
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
View AuditTrailWithoutUsername
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Linq;
namespace DataModel
{
enum EntityCommandType
You can’t perform that action at this time.